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