示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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.");
        }
示例#4
0
        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();
            }
        }
示例#5
0
 public void DeleteLog()
 {
     _logService.Clear();
 }
示例#6
0
 public void Initialize()
 {
     this.handler = new Mock <ILogHandler>();
     LogService.Initialize(this.handler.Object);
     LogService.Clear();
 }
示例#7
0
 public void Stop()
 {
     watcher.Stop();
     ping.Stop();
     LogService.Clear();
 }