public override bool Equals(System.Object obj) { // If parameter is null return false. if (obj == null) { return(false); } // If parameter cannot be cast to Point return false. DvOrdered <T> orderedValue = obj as DvOrdered <T>; if ((object)orderedValue == null) { return(false); } // Return true if the ordered value match: if (this.IsStrictlyComparableTo(orderedValue)) { return(this.CompareTo(orderedValue) == 0); } else { return(false); } }
public override bool IsStrictlyComparableTo(DvOrdered <DvProportion> other) { DvProportion otherObj = other as DvProportion; DesignByContract.Check.Require(other != null && otherObj != null); return(otherObj.Type == this.Type); }
public override bool IsStrictlyComparableTo(DvOrdered <DvQuantity> other) { DvQuantity otherObj = other as DvQuantity; DesignByContract.Check.Require(otherObj != null); if (!otherObj.Units.Equals(this.Units, StringComparison.InvariantCulture)) { return(false); } return(true); }
public bool Equals(DvOrdered <T> orderedValue) { // If parameter is null return false: if ((object)orderedValue == null) { return(false); } // Return true if the ordered value match: if (this.IsStrictlyComparableTo(orderedValue)) { return(this.CompareTo(orderedValue) == 0); } else { return(false); } }
public abstract bool IsStrictlyComparableTo(DvOrdered <T> other);
public override bool IsStrictlyComparableTo(DvOrdered <DvOrdinal> other) { DesignByContract.Check.Require(other != null && other is DvOrdinal); return(true); }