コード例 #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));
        }
コード例 #2
0
        public int Compare(TSource element, TSource minElement)
        {
            var firstCompareResult = FirstComparer.Compare(element, minElement);

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

            return(SecondComparer.Compare(element, minElement));
        }
コード例 #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));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: ComboComparer.cs プロジェクト: yohey03518/lab
        public int Compare(TType x, TType y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

            return(firstCompareResult != 0 ? firstCompareResult : SecondComparer.Compare(x, y));
        }
コード例 #6
0
        public int Compare(Employee x, Employee y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

            return(firstCompareResult == 0 ? SecondComparer.Compare(x, y) : firstCompareResult);
        }
コード例 #7
0
        public int Compare(Employee x, Employee y)
        {
            var firstCompareResult = FirstComparer.Compare(x, y);

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