public static async Task Reset() { LogService.Clear(); Console.WriteLine("Loading..."); // Poor mans loading bar \o/ var viewModel = new MainViewModel(File.ReadAllText(m_configLocation)); await viewModel.Initialize(); Viewer.Reset(viewModel); }
public static async void Reset() { try { LogService.Clear(); Console.WriteLine("Loading..."); // Poor mans loading bar \o/ var viewModel = new MainViewModel(ConfigurationService.GetConfig()); await viewModel.Initialize(); Viewer.Reset(viewModel); } catch (Exception e) { Console.WriteLine(e.Message); LogService.Log(e.Message); } }
public void Start() { LogService.Clear(); LogService.Log("starting up the service."); api = new XillioApi("http://tenant.localhost:8080/", true); RunAuthentication(); //Setup other services watcher = new WatcherService(api); try { ping = new PingService(api); } catch (Exception e) { LogService.Log(e); throw; } LogService.Log("service started."); }
public void HandleInput(ConsoleKeyInfo input) { if (m_traverser.Handles(input)) { m_traverser.Handle(input); } else if (m_textHandler.Handles(input)) { m_textHandler.Handle(input); UpdateCurrentItems(); } else if (input.Key == ConsoleKey.Escape) { m_textHandler.Clear(); UpdateCurrentItems(); LogService.Clear(); } else if (input.Key == ConsoleKey.Tab) { LogService.Clear(); Program.Reset(); } else if (input.Key == ConsoleKey.Enter && m_currentItems.Count > 0) { var item = m_currentItems[m_traverser.Current]; var actions = m_currentItems[m_traverser.Current].ActionsFactory(); if (actions.Length == 1) { actions[0].Action(); } else { Viewer.Push(new ActionSelectionViewModel(item, actions)); } m_textHandler.Clear(); UpdateCurrentItems(); } }
public void DeleteLog() { _logService.Clear(); }
public void Initialize() { this.handler = new Mock <ILogHandler>(); LogService.Initialize(this.handler.Object); LogService.Clear(); }
public void Stop() { watcher.Stop(); ping.Stop(); LogService.Clear(); }