コード例 #1
0
ファイル: WuAgent.cs プロジェクト: hobbit19/wumgr
 // Implementation of IInstallationProgressChangedCallback interface...
 public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
 {
     // !!! warning this function is invoced from a different thread !!!
     agent.mDispatcher.Invoke(new Action(() => {
         agent.OnProgress(installationJob.Updates.Count, callbackArgs.Progress.PercentComplete, callbackArgs.Progress.CurrentUpdateIndex + 1,
                          callbackArgs.Progress.CurrentUpdatePercentComplete, installationJob.Updates[callbackArgs.Progress.CurrentUpdateIndex].Title);
     }));
 }
コード例 #2
0
 // Implementation of IDownloadProgressChangedCallback interface...
 public void Invoke(IInstallationJob iInstallationJob, IInstallationProgressChangedCallbackArgs e)
 {
     form1.setTextBox1Notification("Installing Update: "
                                   + e.Progress.CurrentUpdateIndex
                                   + " / "
                                   + iInstallationJob.Updates.Count
                                   + " - "
                                   + e.Progress.CurrentUpdatePercentComplete + "% Complete");
 }
コード例 #3
0
 void IInstallationProgressChangedCallback.Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
 {
     if (this.showProgress)
     {
         IInstallationProgress progress = callbackArgs.Progress;
         Console.WriteLine("WUA_InstallationProgress:{0}|{1}|{2}",
             progress.CurrentUpdateIndex + 1,
             progress.CurrentUpdatePercentComplete,
             progress.PercentComplete);
     }
 }
コード例 #4
0
ファイル: WindowsUpdateDialog.cs プロジェクト: zinsser/dp2
 // Implementation of IDownloadProgressChangedCallback interface...
 public void Invoke(IInstallationJob iInstallationJob, IInstallationProgressChangedCallbackArgs e)
 {
     form1.ShowProgressMessage(
         "progress_install",
         "安装进度: "
         + e.Progress.CurrentUpdateIndex
         + " / "
         + iInstallationJob.Updates.Count
         + " - 已完成 "
         + e.Progress.CurrentUpdatePercentComplete + "%");
 }
コード例 #5
0
        /// <summary>
        /// Used by the windows update api. Do not call this method.
        /// </summary>
        void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
        {
            bool doCallback = true;

            lock (JobLock)
            {
                if (Job != null && Job.InternalJobObject == installationJob && !Job.IsCompleted)
                {
                    StateDesc  = installationJob.Updates[callbackArgs.Progress.CurrentUpdateIndex].Title;
                    doCallback = true;
                }
            }
            if (doCallback) // calling the callback inside the lock can lead to deadlocks when the callback tries to dispose this object
            {
                OnProgress(installationJob.Updates[callbackArgs.Progress.CurrentUpdateIndex], callbackArgs.Progress.CurrentUpdateIndex, installationJob.Updates.Count, callbackArgs.Progress.PercentComplete);
            }
        }
コード例 #6
0
 //Installation Progress callback
 void IInstallationProgressChangedCallback.Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
 {
     try
     {
         DebugLog($"Install progress: {callbackArgs.Progress.PercentComplete}%; " +
                  $"Update {installationJob.Updates[callbackArgs.Progress.CurrentUpdateIndex].Title}: {callbackArgs.Progress.CurrentUpdatePercentComplete}%");
         //Info(Dump(callbackArgs.Progress));
         ProgressChanged?.Invoke(callbackArgs.Progress.PercentComplete, installationJob.Updates[callbackArgs.Progress.CurrentUpdateIndex].Title);
     }
     catch (Exception ex)
     {
         Log.Error("IInstallationProgressChangedCallback.Invoke", ex.ToString());
     }
 }
コード例 #7
0
 public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs) => _state.Invoke(installationJob, callbackArgs);
コード例 #8
0
 public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
 {
     ServiceEventSource.Current.InfoMessage("Callback: Installation of Windows Updates is In-Progress. Percent completed : {0}", installationJob.GetProgress().PercentComplete);
 }
コード例 #9
0
 public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
 {
     this.Progress = callbackArgs.Progress;
 }
コード例 #10
0
ファイル: WindowsUpdateDialog.cs プロジェクト: renyh1013/dp2
 // Implementation of IDownloadProgressChangedCallback interface...
 public void Invoke(IInstallationJob iInstallationJob, IInstallationProgressChangedCallbackArgs e)
 {
     form1.ShowProgressMessage(
         "progress_install",
         "安装进度: "
      + e.Progress.CurrentUpdateIndex
      + " / "
      + iInstallationJob.Updates.Count
      + " - 已完成 "
      + e.Progress.CurrentUpdatePercentComplete + "%");
 }
コード例 #11
0
            public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
            {
                var clearProgressFlag = false;
                try
                {
                    if (_updateInProgress) return;

                    _updateInProgress = true;
                    clearProgressFlag = true;
                    var wrapper = new UpdateWrapper(installationJob, callbackArgs);
                    wrapper.AdjustValues(_lastWrapper);
                    _lastWrapper = wrapper;
                    SetTitle(wrapper);
                    SetText(wrapper);
                }
                catch (Exception e)
                {
                    Log.WarnFormat("An issue occurred while handling an install update progress changed event: {0}", e);
                }
                finally
                {
                    if (clearProgressFlag) _updateInProgress = false;
                }
            }
コード例 #12
0
 public UpdateWrapper(IInstallationJob job, IInstallationProgressChangedCallbackArgs args)
 {
     TotalUpdates = job.Updates.Count;
     TotalPercent = args.Progress.PercentComplete;
     CurrentIndex = args.Progress.CurrentUpdateIndex+1;
     Title = job.Updates[args.Progress.CurrentUpdateIndex].Title;
     UpdatePercent = args.Progress.CurrentUpdatePercentComplete;
 }
コード例 #13
0
 public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs) => Action?.Invoke(callbackArgs.Progress);
コード例 #14
0
 public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs e)
 {
     WindowsUpdateFrame.progressWindow.Dispatcher.BeginInvoke(new Action(() => WindowsUpdateFrame.progressWindow.progressBar1.Value = e.Progress.PercentComplete));
     WindowsUpdateFrame.progressWindow.Dispatcher.BeginInvoke(new Action(() => WindowsUpdateFrame.progressWindow.textBlock1.Text    = e.Progress.PercentComplete.ToString() + "%"));
 }
コード例 #15
0
 void IInstallationProgressChangedCallback.Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs)
 {
     if (this.showProgress)
     {
         IInstallationProgress progress = callbackArgs.Progress;
         Console.WriteLine("WUA_InstallationProgress:{0}|{1}|{2}",
                           progress.CurrentUpdateIndex + 1,
                           progress.CurrentUpdatePercentComplete,
                           progress.PercentComplete);
     }
 }