Beispiel #1
0
 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;
         }));
     }
 }
Beispiel #2
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);
            }
        }
Beispiel #3
0
 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;
             }));
         }
     }
 }