Esempio n. 1
0
        public static bool ListTimeSlots(string[] com)
        {
            if (com.Length < 2)
            {
                return(false);
            }
            if (com[0] != "list")
            {
                return(false);
            }
            if (com[1] != "timeslots")
            {
                return(false);
            }
            TimeSlotFile cf = Schedule.timeslots;

            if (com.Length >= 3 && com[2] == "archive")
            {
                cf = Schedule.timeslotsArchive;
            }
            Conzole.PrintLine("Found " + cf.Size() + " timeslots.", ConsoleColor.Magenta);
            for (int i = 0; i < cf.Size(); i++)
            {
                TimeSlot ts = cf.Get(i);
                Conzole.Print(Conzole.PadBefore(ts.startSec + ":" + ts.startMin + ":" + ts.startHou + " >> ", 12), ConsoleColor.Yellow);
                Conzole.Print(Conzole.PadBefore(ts.endSec + ":" + ts.endMin + ":" + ts.endHou, 8), ConsoleColor.Yellow);
                Conzole.Print(" - " + Conzole.PadAfter(ts.name, 50));
                Conzole.Print("\n");
            }
            return(true);
        }
Esempio n. 2
0
 static Schedule()
 {
     deadlines        = new DeadlineFile("deadlineData");
     cards            = new CardFile("cardData");
     deadlinesArchive = new DeadlineFile("deadlineArchiveData");
     cardsArchive     = new CardFile("cardsArchiveData");
     timeslots        = new TimeSlotFile("timerangeData");
     timeslotsArchive = new TimeSlotFile("timerangeArchiveData");
 }