Ejemplo n.º 1
0
        private static void Initialize()
        {
            JobMenu      = new ConsoleControl(col: 1, row: 2, width: WindowWidth / 2 - 1, height: Data.jobs.Count);
            JobDetails   = new ConsoleControl(col: WindowWidth / 2 + 1, row: 2, width: WindowWidth / 2 - 1, height: 5);
            JobEmployees = new ConsoleControl(col: WindowWidth / 2 + 1, row: JobDetails.Height + 3, width: WindowWidth / 2 - 1, height: WindowHeight - JobDetails.Height - 1);

            JobMenu.BackColor      = ConsoleColor.Gray;
            JobMenu.TextColor      = ConsoleColor.Blue;
            JobDetails.BackColor   = ConsoleColor.Gray;
            JobDetails.TextColor   = ConsoleColor.Green;
            JobEmployees.BackColor = ConsoleColor.Gray;
            JobEmployees.TextColor = ConsoleColor.Red;

            BindMenuData(Data.jobs);

            Mediator.Instance.JobChanged += Hanskaaja;
        }
Ejemplo n.º 2
0
        //Ohjeen määrittelemä Initialize metodi.
        private static void Initialize()
        {
            //Consolecontrol olioiden ominaisuuksien määrittely.
            JobMenu      = new ConsoleControl(1, 2, WindowWidth / 2 - 1, Data.jobs.Count());
            JobDetails   = new ConsoleControl(WindowWidth / 2 + 1, 2, WindowWidth / 2 - 1, 5);
            JobEmployees = new ConsoleControl(WindowWidth / 2 + 1, JobDetails.Height + 3, WindowWidth / 2 - 1, WindowHeight - JobDetails.Height - 1);

            //Olioden tekstivärin asettaminen.
            JobMenu.TextColor      = ConsoleColor.DarkBlue;
            JobDetails.TextColor   = ConsoleColor.DarkGreen;
            JobEmployees.TextColor = ConsoleColor.DarkRed;

            //Menuvalikon muuttujien asetus/mahdollinen päivitys.
            BindMenuData(Data.jobs);

            //Mediaattorille asetettu tapahtumanseuranta.
            Mediator.Instance.JobChanged += InsJobChanged;
        }