public static void SaveWingetIdSettings(string idFilePath, WingetIdSettings wingetidSettings) { string json = JsonSerializer.Serialize(wingetidSettings, new JsonSerializerOptions() { WriteIndented = true }); File.WriteAllText(idFilePath, json); }
public static string[] GetVersionsToIgnoreDownload(string idFilePath) { string[] result = new string[] { }; try { WingetIdSettings settings = LoadWingetIdSettings(idFilePath); if (settings?.VersionsToIgnoreDownload != null) { result = settings.VersionsToIgnoreDownload; } } catch (JsonException ex) { Trace.WriteLine("Error during deserialization of '" + idFilePath + "': " + ex.Message); } return(result); }