public static IEnumerable <string> GetAllLibraries() { yield return(GetPathFromRegistry()); foreach (var library in VdfHelper.GetKeyPairs(File.ReadAllLines(GetSteamConfigPath()), "BaseInstallFolder_") .Select(libraryPath => libraryPath.Value)) { yield return(Path.GetFullPath(library)); } }
public static void ApplyBehaviorChanges(ListBox lsLibraries, ListBox lsLog, int updateChoice) { lsLog.Items.Clear(); foreach (var item in lsLibraries.SelectedItems) { foreach (var game in GetAllGames(item.ToString())) { var gameText = File.ReadAllLines(game).ToList(); var gameName = VdfHelper.GetKeyPairs(gameText, "name"); gameText = new List <string>(VdfHelper.SetKeyPair(gameText, new KeyValuePair <string, string>("AutoUpdateBehavior", updateChoice.ToString()))); File.WriteAllLines(game, gameText); foreach (var name in gameName) { lsLog.Items.Add(name.Value); } } } }