Ejemplo n.º 1
0
 static public bool IfUpdateExist(IUpdate5 update, List <Dictionary <string, string> > UpdateIdsHistory)
 {
     try
     {
         foreach (var dictionary in UpdateIdsHistory.Select((value, i) => new { i, value }))
         {
             if (dictionary.value["UpdateID"] == update.Identity.UpdateID && dictionary.value["RevisionNumber"] == update.Identity.RevisionNumber.ToString())
             {
                 UpdateIdsHistory.RemoveAt(dictionary.i);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     return(false);
 }
            public void Report(IDownloadProgress value)
            {
                IUpdate5 currentUpdate = (IUpdate5)_updateDownloader.Updates[value.CurrentUpdateIndex];

                _cmdlet.WriteProgress(
                    ProgressRecordFactory.Progress(
                        0,
                        "Downloading Update Collection",
                        $"Download Phase {value.CurrentUpdateDownloadPhase}",
                        value.CurrentUpdateIndex / _updateDownloader.Updates.Count));

                _cmdlet.WriteProgress(
                    ProgressRecordFactory.Progress(
                        1,
                        "Dowloading update",
                        $"Downlading {value.CurrentUpdateBytesDownloaded} of {value.CurrentUpdateBytesToDownload}",
                        $"Downlading {value.CurrentUpdateIndex} of {_updateDownloader.Updates.Count}",
                        value.CurrentUpdatePercentComplete));
            }
Ejemplo n.º 3
0
 public WindowsUpdate(IUpdate5 update)
 {
     _update = update;
 }