// 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); })); }
// 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"); }
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); } }
// Implementation of IDownloadProgressChangedCallback interface... public void Invoke(IInstallationJob iInstallationJob, IInstallationProgressChangedCallbackArgs e) { form1.ShowProgressMessage( "progress_install", "安装进度: " + e.Progress.CurrentUpdateIndex + " / " + iInstallationJob.Updates.Count + " - 已完成 " + e.Progress.CurrentUpdatePercentComplete + "%"); }
/// <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); } }
//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()); } }
public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs) => _state.Invoke(installationJob, callbackArgs);
public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs) { ServiceEventSource.Current.InfoMessage("Callback: Installation of Windows Updates is In-Progress. Percent completed : {0}", installationJob.GetProgress().PercentComplete); }
public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs) { this.Progress = callbackArgs.Progress; }
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; } }
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; }
public void Invoke(IInstallationJob installationJob, IInstallationProgressChangedCallbackArgs callbackArgs) => Action?.Invoke(callbackArgs.Progress);
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() + "%")); }