Exemplo 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);
        }
Exemplo 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();
                }
            }
        }
Exemplo n.º 3
0
 public void OptionLoadSession(uiListable session)
 {
     app = file.Load((Session)session);
     ui  = new PresentationLayer(app);
 }
Exemplo n.º 4
0
 public PresentationLayer(ApplicationLayer a)
 {
     this.app = a;
 }