Beispiel #1
0
        int IComparable.CompareTo(object mag)
        {
            Magazine magazine = mag as Magazine;

            if (this.price < magazine.price)
            {
                return(-1);
            }
            else if (this.price > magazine.price)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Beispiel #2
0
            int IComparer.Compare(object obj1, object obj2)
            {
                Magazine magazine1 = obj1 as Magazine;
                Magazine magazine2 = obj2 as Magazine;

                if (magazine1.rating > magazine2.rating)
                {
                    return(1);
                }
                else if (magazine1.rating < magazine2.rating)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            }
Beispiel #3
0
            int IComparer.Compare(object obj1, object obj2)
            {
                Magazine magazine1 = obj1 as Magazine;
                Magazine magazine2 = obj2 as Magazine;

                if (magazine1.pagesAmount > magazine2.pagesAmount)
                {
                    return(1);
                }
                else if (magazine1.pagesAmount < magazine2.pagesAmount)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            }