public void SetProgress(object callingObj, double pct) { if (!this.disableStepProgress || ReferenceEquals(this.controllingObject, callingObj)) { ThreadSafeDispatcher.Invoke((Action)(() => { Application.Current.MainWindow.TaskbarItemInfo.ProgressValue = pct / 100.0; })); } }
private void Run() { while (this.hasRun == false) { if (DateTime.UtcNow >= this.startTime.Add(this.timeSpan)) { ThreadSafeDispatcher.Invoke(this.actionToRun); this.hasRun = true; } Thread.Sleep(50); } }
public void ShowProgress(object callingObj, bool doShow) { if (!this.disableStepProgress || ReferenceEquals(this.controllingObject, callingObj)) { if (doShow) { ThreadSafeDispatcher.Invoke((Action)(() => { Application.Current.MainWindow.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal; })); } else { ThreadSafeDispatcher.Invoke((Action)(() => { Application.Current.MainWindow.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None; })); } } }