Beispiel #1
0
 public ConsolePage(PrintHandler handler, T data, HotkeyBar hotkeybar)
 {
     this._printHandler = handler;
     this.DataProvider  = data;
     this.Hotkeys       = hotkeybar;
 }
Beispiel #2
0
        private void InitPages(){

            //** MAIN PAGE ***********************************
  
            HotkeyBarItem startStopKey = new HotkeyBarItem(ConsoleKey.F4, "Start / Stop", HotKeyEventHandler_StateToggle);
            HotkeyBarItem optinsKey = new HotkeyBarItem(ConsoleKey.F6, "Options", HotKeyEventHandler_Options);
            HotkeyBarItem exitKey = new HotkeyBarItem(ConsoleKey.F10, "Exit", HotKeyEventHandler_Exit, 3);

            HotkeyBar mainBar = new HotkeyBar(4);
            mainBar.Items.Add(startStopKey);
            mainBar.Items.Add(optinsKey);
            mainBar.Items.Add(exitKey);

            mainPage = new ConsolePage<Service>(MainPagePrintHandler, service, mainBar);

            //** OPTIONS PAGE ********************************

            HotkeyBarItem escKey1 = new HotkeyBarItem(ConsoleKey.Escape, "ESC", "Back", HotKeyEventHandler_OptionsCancel);
            HotkeyBarItem addKey = new HotkeyBarItem(ConsoleKey.Insert, "INS", "Add", HotKeyEventHandler_ListAdd);
            HotkeyBarItem removeKey = new HotkeyBarItem(ConsoleKey.Delete, "DEL", "Remove", HotKeyEventHandler_ListRem);
            HotkeyBarItem upKey = new HotkeyBarItem(ConsoleKey.UpArrow, "   ↑", "", HotKeyEventHandler_ListUp);
            HotkeyBarItem downKey = new HotkeyBarItem(ConsoleKey.DownArrow, " ↓", "", HotKeyEventHandler_ListDown);
            HotkeyBarItem homeKey = new HotkeyBarItem(ConsoleKey.Home, "HOME", "", HotKeyEventHandler_ListStart);
            homeKey.Visible = false;
            HotkeyBarItem endKey = new HotkeyBarItem(ConsoleKey.End, "END", "", HotKeyEventHandler_ListEnd);
            endKey.Visible = false;

            HotkeyBar optionsBar = new HotkeyBar(4);
            optionsBar.Items.Add(escKey1);
            optionsBar.Items.Add(addKey);
            optionsBar.Items.Add(removeKey);
            optionsBar.Items.Add(exitKey);
            optionsBar.Items.Add(upKey);
            optionsBar.Items.Add(downKey);
            optionsBar.Items.Add(homeKey);
            optionsBar.Items.Add(endKey);

            optionsPage = new ConsolePage<Service>(OptionsPagePrintHandler, service, optionsBar);

            //** ADD EXECUTABLE PAGE *************************

            HotkeyBarItem escKey2 = new HotkeyBarItem(ConsoleKey.Escape, "ESC", "Cancel", HotKeyEventHandler_CaptureModeCancel);
            HotkeyBarItem okKey = new HotkeyBarItem(ConsoleKey.Enter, " ENTER","Add Executable", HotKeyEventHandler_CaptureModeOK);

            HotkeyBar addExeBar = new HotkeyBar(4);
            addExeBar.Items.Add(escKey2);
            addExeBar.Items.Add(okKey);
            addExeBar.Items.Add(exitKey);

            addExePage = new ConsolePage<Service>(AddExePagePrintHandler, service, addExeBar);
        }