Ejemplo n.º 1
0
    // override object.Equals
    public override bool Equals(object obj)
    {
        //
        // See the full list of guidelines at
        //   http://go.microsoft.com/fwlink/?LinkID=85237
        // and also the guidance for operator== at
        //   http://go.microsoft.com/fwlink/?LinkId=85238
        //

        if (obj == null || GetType() != obj.GetType())
        {
            return(false);
        }

        var timeRange = (TimeRange)obj;

        return(From.Equals(timeRange.From) && To.Equals(timeRange.To) &&
               FromInclusive.Equals(timeRange.FromInclusive) && ToInclusive.Equals(timeRange.ToInclusive));
    }
Ejemplo n.º 2
0
        public bool Equals(ValueInterval other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (IsEmpty && other.IsEmpty)
            {
                return(true);
            }

            return(From.Equals(other.From) && To.Equals(other.To) &&
                   FromInclusive.Equals(other.FromInclusive) &&
                   ToInclusive.Equals(other.ToInclusive));
        }