public MainWindow() { _errorHandler = new ErrorHandler(this); try { InitializeComponent(); _configReader = new ConfigReader(Directory.GetCurrentDirectory() + @"\LauncherConfig\Launcher.config", _errorHandler); _configReader.GetDataFromFile(); foreach (var game in _configReader.Games) { ListOfMods.Items.Add(game); } ListOfMods.SelectedItem = _configReader.LastLaunchGame; string[] launchMods = { "Win 7/8/8.1/10", "Win Xp (and lower)" }; ListOfLaunchMode.ItemsSource = launchMods; ListOfLaunchMode.SelectedItem = _configReader.LastLaunchMode; LabelVersion.Content = "Version: " + _configReader.Version; ModDescription.Text = _configReader.Descriptions[ListOfMods.SelectedIndex]; var logo = new BitmapImage(new Uri(Directory.GetCurrentDirectory() + @"\LauncherConfig" + _configReader.Pictures[ListOfMods.SelectedIndex])); Image.Source = logo; } catch (Exception ex) { _errorHandler.CallErrorWindows(ex, "MainWindow"); } }
public Settings(ConfigReader configReader, ErrorHandler errorHandler) { _errorHandler = errorHandler; try { _gameSettings = new GameSettingsService(_errorHandler); ConfigReaderLocal = configReader; LastHdMode = ConfigReaderLocal.ReadHdMode(); InitializeComponent(); _gameSettings.GetDataFromFile(); InitializeSettings(); } catch (Exception ex) { _errorHandler.CallErrorWindows(ex, "Settings"); } }
public ConfigReader(string uri, ErrorHandler errorHandler) { _errorHandler = errorHandler; try { Uri = uri; ListBaseConfigDictionary = new List<Dictionary<string, string>>(); ListWithOutHdConfigDictionary = new List<Dictionary<string, string>>(); ListWithHdWithDefaultSightConfigDictionary = new List<Dictionary<string, string>>(); ListWithHdWithSmallSightConfigDictionary = new List<Dictionary<string, string>>(); ListWithHdWithHardcoreSightConfigDictionary = new List<Dictionary<string, string>>(); ListWithHdWithOvalSightConfigDictionary = new List<Dictionary<string, string>>(); } catch (Exception ex) { _errorHandler.CallErrorWindows(ex, "ConfigReader"); } }
public WriteConfig(ErrorHandler errorHandler) { _errorHandler = errorHandler; }
public GameSettingsService(ErrorHandler errorHandler) { _errorHandler = errorHandler; }