public override int GetHashCode() { var hashCode = -331517974; hashCode = hashCode * -1521134295 + ColorType.GetHashCode(); hashCode = hashCode * -1521134295 + (ColorType == XLColorType.Indexed ? Indexed.GetHashCode() : 0); hashCode = hashCode * -1521134295 + (ColorType == XLColorType.Theme ? ThemeColor.GetHashCode() : 0); hashCode = hashCode * -1521134295 + (ColorType == XLColorType.Theme ? ThemeTint.GetHashCode() : 0); hashCode = hashCode * -1521134295 + (ColorType == XLColorType.Color ? Color.ToArgb().GetHashCode() : 0); return(hashCode); }
private static void AssertNotEqual <T>(Indexed <T> first, Indexed <T> second) { Assert.IsFalse(first == second); Assert.IsFalse(second == first); Assert.IsTrue(first != second); Assert.IsTrue(second != first); Assert.IsFalse(first.Equals(second)); Assert.IsFalse(second.Equals(first)); Assert.IsFalse(object.Equals(first, second)); Assert.IsFalse(object.Equals(second, first)); Assert.AreNotEqual(first.GetHashCode(), second.GetHashCode()); }
public override int GetHashCode() { unchecked { int hash = 397; hash = hash * 23 + Argb.GetHashCode(); hash = hash * 23 + Auto?.GetHashCode() ?? 0; hash = hash * 23 + Indexed?.GetHashCode() ?? 0; hash = hash * 23 + Theme?.GetHashCode() ?? 0; hash = hash * 23 + Tint?.GetHashCode() ?? 0; return(hash); } }