コード例 #1
0
        public void LoadScreens(string screensDirectory, ConsoleObj console)
        {
            string [] screensFiles = Directory.GetFiles(screensDirectory, "*.yaml");
            _console = console;

            foreach (string screenFile in screensFiles)
            {
                ConsoleScreen screen = new ConsoleScreen();
                screen.LoadScreen(screenFile);
                _screens.Add(screen);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: LuisKeys/core_console_lib
        static void Main(string[] args)
        {
            ConsoleObj     console      = new ConsoleObj();
            ConsoleScreens screens      = new ConsoleScreens();
            ConsoleInput   consoleInput = new ConsoleInput(console);

            screens.LoadScreens(@"samples\simple_screen\", console);
            screens.RenderScreen("home");
            consoleInput.ReadInput();

            screens.UpdateFieldValue("home", "pages", 1);
            consoleInput.ReadInput();


            screens.UpdateFieldValue("home", "pages", 0);
            consoleInput.ReadInput();

            Environment.Exit(0);
        }
コード例 #3
0
        public void RenderUIElement(ConsoleUIElement element, ConsoleObj console)
        {
            _console = console;
            _element = element;
            switch (element.Type)
            {
            case ConsoleUIElementTypes.COLOR:
                this.renderColor();
                break;

            case ConsoleUIElementTypes.LABEL:
                this.renderLabel();
                break;

            case ConsoleUIElementTypes.BOX:
                this.renderBox();
                break;

            case ConsoleUIElementTypes.TABS:
                this.renderTabs();
                break;
            }
        }
コード例 #4
0
 public ConsoleUIPrimitives(ConsoleObj console)
 {
     _console = console;
 }
コード例 #5
0
 public ConsoleInput(ConsoleObj console)
 {
     _console = console;
 }