Пример #1
0
        public static void SaveWingetIdSettings(string idFilePath, WingetIdSettings wingetidSettings)
        {
            string json = JsonSerializer.Serialize(wingetidSettings, new JsonSerializerOptions()
            {
                WriteIndented = true
            });

            File.WriteAllText(idFilePath, json);
        }
Пример #2
0
 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);
 }