From 94b6aa0d1b5fa43ef62dc2a3d35543e5e7eda7ed Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 22 Jan 2022 23:20:04 +0100 Subject: [PATCH] Marked StyleProp equality members as obsolete --- CHANGELOG.md | 3 +++ MLEM.Ui/Style/StyleProp.cs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 612b5a4..ed53b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ Improvements Fixes - Fixed paragraph links having incorrect hover locations when using special text alignments +Removals +- Marked StyleProp equality members as obsolete + ### MLEM.Extended Improvements - Preserve texture region names when converting between MLEM and MG.Extended diff --git a/MLEM.Ui/Style/StyleProp.cs b/MLEM.Ui/Style/StyleProp.cs index 5dac89d..21db659 100644 --- a/MLEM.Ui/Style/StyleProp.cs +++ b/MLEM.Ui/Style/StyleProp.cs @@ -75,6 +75,7 @@ namespace MLEM.Ui.Style { /// Indicates whether the current object is equal to another object of the same type. /// An object to compare with this object. /// true if the current object is equal to the other parameter; otherwise, false. + [Obsolete("StyleProp equality is ambiguous as it is not clear whether priority is taken into account. Compare Values instead.")] public bool Equals(StyleProp other) { return EqualityComparer.Default.Equals(this.Value, other.Value); } @@ -82,12 +83,14 @@ namespace MLEM.Ui.Style { /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// true if obj and this instance are the same type and represent the same value; otherwise, false. + [Obsolete("StyleProp equality is ambiguous as it is not clear whether priority is taken into account. Compare Values instead.")] public override bool Equals(object obj) { return obj is StyleProp other && this.Equals(other); } /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. + [Obsolete("StyleProp equality is ambiguous as it is not clear whether priority is taken into account. Compare Values instead.")] public override int GetHashCode() { return EqualityComparer.Default.GetHashCode(this.Value); } @@ -122,6 +125,7 @@ namespace MLEM.Ui.Style { /// The left style property. /// The right style property. /// Whether the two style properties are equal. + [Obsolete("StyleProp equality is ambiguous as it is not clear whether priority is taken into account. Compare Values instead.")] public static bool operator ==(StyleProp left, StyleProp right) { return left.Equals(right); } @@ -132,6 +136,7 @@ namespace MLEM.Ui.Style { /// The left style property. /// The right style property. /// Whether the two style properties are not equal. + [Obsolete("StyleProp equality is ambiguous as it is not clear whether priority is taken into account. Compare Values instead.")] public static bool operator !=(StyleProp left, StyleProp right) { return !left.Equals(right); }