コード例 #1
0
        public virtual int CompareTo(ConceptAs <T> other)
        {
            if (other == null)
            {
                return(1);
            }

            return(Comparer <T> .Default.Compare(this.Value, other.Value));
        }
コード例 #2
0
        /// <summary>
        /// Determines whether two object instances are equal.
        /// </summary>
        /// <param name="other">The object to compare with the current object.</param>
        /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
        public virtual bool Equals(ConceptAs <T> other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            var t         = GetType();
            var otherType = other.GetType();

            return(t == otherType && EqualityComparer <T> .Default.Equals(Value, other.Value));
        }
コード例 #3
0
 /// <summary>
 /// Determines how two <see cref="ConceptAs{T}"/> instances compares to each other.
 /// </summary>
 /// <param name="other">The <see cref="ConceptAs{T}"/> to compare with the current <see cref="ConceptAs{T}"/>.</param>
 /// <returns>Comparison result.</returns>
 public virtual int CompareTo(ConceptAs <T> other)
 {
     return(other == null ? 1 : Comparer <T> .Default.Compare(Value, other.Value));
 }