Esempio n. 1
0
        public int CompareTo(ScheduleEntry other)
        {
            int dayComp = DayOfWeek.CompareTo(other.DayOfWeek);

            if (dayComp == 0)
            {
                return(StartSlot.CompareTo(other.StartSlot));
            }
            return(dayComp);
        }
Esempio n. 2
0
        public override string ToString()
        {
            // For example:
            // | Type ID  |   0     |0    1    2
            // | Table ID |         |0    1    2
            // +----------+---------+---------------------------------------

            var sb = new StringBuilder();

            string slotSpan = (SlotSpan == 1)
                                ? StartSlot.ToString() :
                              string.Format("{0}-{1}", StartSlot, StartSlot + SlotSpan - 1);

            sb.AppendLine(string.Format("// | Type ID  |   {0,-5} |{1}", slotSpan,
                                        string.Join(" ", TypeIDs.Select(x => string.Format("{0,-4}", x)))));
            sb.AppendLine(string.Format("// | Table ID |         |{0}",
                                        string.Join(" ", TableIDs.Select(x => string.Format("{0,-4}", x)))));
            sb.AppendLine("// +----------+---------+---------------------------------------");
            return(sb.ToString());
        }