Esempio n. 1
0
        public ApplicationLayer Load(Session session)
        {
            string           jcontent = File.ReadAllText(string.Format(".\\saves\\{0}.json", session.Name));
            SessionContent   content  = JsonConvert.DeserializeObject <SessionContent>(jcontent);
            ApplicationLayer app      = new ApplicationLayer(content.tickets, content.pieces);

            Ticket[] closed = app.FilterTicketsBy((t) => t.Closed);
            if (closed != null)
            {
                foreach (Ticket ticket in closed)
                {
                    ticket.CalculateDuration(); //recalculate Durations
                }
            }
            return(app);
        }
Esempio n. 2
0
        public void Main()
        {
            this.app  = new ApplicationLayer();
            this.ui   = new PresentationLayer(app);
            this.file = new PersistencyLayer();
            BuildMenu();
            Menu currentMenu = mainMenu;

            while (running)
            {
                MenuEntry choice = Navigate(currentMenu);
                if (choice is Menu)
                {
                    currentMenu = (Menu)choice;
                }
                if (choice is Option)
                {
                    Option pick = (Option)choice;
                    pick.Perform();
                }
            }
        }
Esempio n. 3
0
 public void OptionLoadSession(uiListable session)
 {
     app = file.Load((Session)session);
     ui  = new PresentationLayer(app);
 }
Esempio n. 4
0
 public PresentationLayer(ApplicationLayer a)
 {
     this.app = a;
 }