System.Collections.Tests.ComparerTests.Foo.CompareTo C# (CSharp) Method

CompareTo() public method

public CompareTo ( object o ) : int
o object
return int
            public int CompareTo(object o)
            {
                if (o is Foo)
                {
                    return IntValue.CompareTo(((Foo)o).IntValue);
                }
                else if (o is Bar)
                {
                    return IntValue.CompareTo(((Bar)o).IntValue);
                }

                throw new ArgumentException("Object is not a Foo or a Bar");
            }
        }
ComparerTests.Foo