예제 #1
0
    // Override
    public int CompareTo(System.Object o)
    {
        if (o == null)
        {
            return(1);
        }

        EventTime t = o as EventTime;

        if (o != null)
        {
            int hourCheck = hours.CompareTo(t.GetHours());
            if (hourCheck != 0)
            {
                return(hourCheck);
            }
            else
            {
                return(minutes.CompareTo(t.GetMinutes()));
            }
        }
        else
        {
            throw new ArgumentException("Object is not a Time");
        }
    }