示例#1
0
        /// <summary>
        ///  Compare this object with another object and return a value that indicates if the current instance precedes
        /// follows or occurs in the same position in the sort order as the other object.
        /// </summary>
        /// <param name="other">An object to compare with this instance.</param>
        /// <returns>A value that indicates the relative order of the objects being compared.</returns>
        public int CompareTo(TemplatedValueObject <TValue> obj)
        {
            if (ReferenceEquals(obj, null))
            {
                throw new ArgumentException("obj is null or of the wrong type");
            }

            return(Value.CompareTo(obj.Value));
        }
示例#2
0
 /// <summary>
 ///  Determine whether the given object is equal to the current object.
 /// </summary>
 /// <param name="obj">The object to compare with the current object.</param>
 /// <returns>True if the specified object is equal to the current object, false otherwise.</returns>
 public bool Equals(TemplatedValueObject <TValue> obj)
 {
     if (ReferenceEquals(null, obj))
     {
         return(false);
     }
     else
     {
         return(ReferenceEquals(this, obj) || Value.Equals(obj.Value));
     }
 }