public void StartMenu() { Console.WriteLine("Checking if first time run..."); // Check first time run if (!_menuLib.CheckFirstTime(_architectureExplorer.IsUnix())) { Console.WriteLine("Welcome back."); var settings = _menuLib.LoadSettings(); if (settings == null) { _collector.AddToMessageQueue(_menuLib.SetAccountSettings()); } _collector.AddToMessageQueue(settings); RetrievedAccSettings = true; BaseMenu(); } else { var settings = _menuLib.SetAccountSettings(); { _collector.AddToMessageQueue(settings); } RetrievedAccSettings = true; } BaseMenu(); }
private void SetupLogFile() { _architectureExplorer = new ArchitectureExplorer(this); if (_architectureExplorer.IsUnix()) { _loggerQueue.Enqueue("Setting up logging directories and file."); _dirPath = _architectureExplorer.ArchRootPath(_unixLoc); } else { _loggerQueue.Enqueue("Setting up logging directories and file."); _dirPath = _architectureExplorer.ArchRootPath(_winLoc); } if (!File.Exists(_dirPath)) { try { Directory.CreateDirectory(_dirPath); } catch (Exception ex) { Console.WriteLine("Could not Create log file. " + ex); Console.WriteLine("Exiting Program... Try running as admin."); Environment.Exit(0); } } _logWriter = new StreamWriter(_dirPath + "ForexTrader.log", true); }