您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

49 行
1.5 KiB

using System;
namespace UIWidgets.widgets {
public class IconData : IEquatable<IconData> {
public IconData(
int codePoint,
string fontFamily = null
) {
this.codePoint = codePoint;
this.fontFamily = fontFamily;
}
public readonly int codePoint;
public readonly string fontFamily;
public bool Equals(IconData other) {
if (object.ReferenceEquals(null, other)) return false;
if (object.ReferenceEquals(this, other)) return true;
return this.codePoint == other.codePoint &&
string.Equals(this.fontFamily, other.fontFamily);
}
public override bool Equals(object obj) {
if (object.ReferenceEquals(null, obj)) return false;
if (object.ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return this.Equals((IconData) obj);
}
public override int GetHashCode() {
unchecked {
return (this.codePoint * 397) ^ (this.fontFamily != null ? this.fontFamily.GetHashCode() : 0);
}
}
public static bool operator ==(IconData left, IconData right) {
return object.Equals(left, right);
}
public static bool operator !=(IconData left, IconData right) {
return !object.Equals(left, right);
}
public override string ToString() {
return "IconData(U+" + this.codePoint.ToString("X5") + ")";
}
}
}