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); } }
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); }
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; } }
public ConsoleUIPrimitives(ConsoleObj console) { _console = console; }
public ConsoleInput(ConsoleObj console) { _console = console; }