예제 #1
0
        private void KeyPressed(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Escape:
                Close();
                break;

            case Key.D0:
                base_.RebootComputer();
                break;

            case Key.D1:
                base_.ShutdownComputer();
                break;

            case Key.D2:
                Process.Start("notepad", base_.SCHEDULES_FILE_LOCATION);
                break;

            case Key.D3:
                Process.Start("cmd");
                break;

            case Key.D4:

                int h = DateTime.Now.Hour;
                int m = DateTime.Now.Minute;

                ScheduleManager.ManuallyUpdateScheduleKeys(new Schedule()
                {
                    ScreenOnTime       = new int[] { h, m + 1 },
                    ScreenOffTime      = new int[] { h, m + 5 },
                    ClockScreenOnTime  = new int[] { h, m + 1 },
                    ClockScreenOffTime = new int[] { h, m },
                    FoodScreenOnTime   = new int[] { h, m + 2 },
                    FoodScreenOffTime  = new int[] { h, m + 4 },
                    BusScreenOnTime    = new int[] { h, m + 4 },
                    BusScreenOffTime   = new int[] { h, m + 5 },
                    RebootTime         = new int[] { h, m + 2 }
                });

                d.write("Schedule reset due to function test.");
                break;

            case Key.D5:
                Process.Start(base_.PWD + "/gajwa-businfo.exe");
                Environment.Exit(0);
                break;

            case Key.D6:
                ArduinoSerialControl.ToggleTVpower();
                break;

            case Key.D7:
                MessageBox.Show("WIP");
                break;
            }
        }
예제 #2
0
        //private PageType LastPageType = PageType.Blank;



        public MainWindow()
        {
            InitializeComponent();
            this.Top = 0; this.Left = 0;

            ScheduleManager.StartWatcher();

            ScheduleManager.ScheduleChanged += ScheduleChangedThread; //이벤트 핸들러
        }