コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: DvProportion.cs プロジェクト: panky2sharma/OpenEHR
        public override bool IsStrictlyComparableTo(DvOrdered <DvProportion> other)
        {
            DvProportion otherObj = other as DvProportion;

            DesignByContract.Check.Require(other != null && otherObj != null);

            return(otherObj.Type == this.Type);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public abstract bool IsStrictlyComparableTo(DvOrdered <T> other);
コード例 #6
0
        public override bool IsStrictlyComparableTo(DvOrdered <DvOrdinal> other)
        {
            DesignByContract.Check.Require(other != null && other is DvOrdinal);

            return(true);
        }