Exemplo n.º 1
0
        public int Compare(Employee x, Employee y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

            if (firstCompareResult != 0)
            {
                return(firstCompareResult);
            }
            return(SecondComparer.Compare(x, y));
        }
        public int Compare(TSource element, TSource minElement)
        {
            var firstCompareResult = FirstComparer.Compare(element, minElement);

            if (firstCompareResult != 0)
            {
                return(firstCompareResult);
            }

            return(SecondComparer.Compare(element, minElement));
        }
Exemplo n.º 3
0
        public virtual int Compare(T x, T y)
        {
            if (ReferenceEquals(x, y))
            {
                return(0);
            }
            if (x == null)
            {
                return(1);
            }
            if (y == null)
            {
                return(-1);
            }

            int n = FirstComparer.Compare(x, y);

            return(n != 0 ? n : SecondComparer.Compare(x, y));
        }
        public bool Equals(TaggedUnion <TFirst, TSecond> other)
        {
            if (tag != other.tag)
            {
                return(false);
            }

            if (tag == Tag.First)
            {
                return(FirstComparer.Equals(first, other.first));
            }

            if (tag == Tag.Second)
            {
                return(SecondComparer.Equals(second, other.second));
            }

            return(true);
        }
Exemplo n.º 5
0
        public int Compare(TType x, TType y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

            return(firstCompareResult != 0 ? firstCompareResult : SecondComparer.Compare(x, y));
        }
Exemplo n.º 6
0
        public int Compare(Employee x, Employee y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

            return(firstCompareResult == 0 ? SecondComparer.Compare(x, y) : firstCompareResult);
        }
Exemplo n.º 7
0
        public int Compare(Employee x, Employee y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

            return(firstCompareResult != 0 ? firstCompareResult : SecondComparer.Compare(x, y));
        }