public MainWindow() { InitializeComponent(); try { picker = new Games(); steamCategoryParser = new SteamCategoryParser(picker); } catch (Exception) { if (File.Exists(steamInstallDirStoragePath)) { ReadInstallLocationAndLoadGames(); } else { PromptForSteamInstallDir(); } } btnPlayRandom.Content = PLAY_RANDOM_TEXT; gamesLists = Playlists.Load(); DataContext = this; playlistBox.ItemsSource = AllPlaylists; playlistBox.SelectedIndex = 0; }
private void ReadInstallLocationAndLoadGames() { using (FileStream reader = new FileStream(steamInstallDirStoragePath, FileMode.Open)) { using (StreamReader locationReader = new StreamReader(reader)) { String actualInstallDir = locationReader.ReadToEnd(); picker = new Games(actualInstallDir); steamCategoryParser = new SteamCategoryParser(picker, actualInstallDir); } } }