void DoHideProgress() { if (!statusProgressBarIsVisible) { // make stuff look nice and delay it a little more by using an animation // on the progress bar TimeSpan timeSpan = TimeSpan.FromSeconds(0.25); var animation = new DoubleAnimation(0, new Duration(timeSpan), FillBehavior.HoldEnd); statusProgressBarItem.BeginAnimation(OpacityProperty, animation); jobNamePanel.BeginAnimation(OpacityProperty, animation); WorkbenchSingleton.CallLater( timeSpan, delegate { if (!statusProgressBarIsVisible) { statusProgressBarItem.Visibility = Visibility.Collapsed; jobNamePanel.Content = currentTaskName = ""; var taskbar = WorkbenchSingleton.MainWindow.TaskbarItemInfo; if (taskbar != null) { taskbar.ProgressState = TaskbarItemProgressState.None; } StopHideProgress(); } }); } }
public void HideProgress() { // LoggingService.Debug("HideProgress()"); statusProgressBarIsVisible = false; // to allow the user to see the red progress bar as a visual clue of a failed // build even if it occurs close to the end of the build, we'll hide the progress bar // with a bit of time delay WorkbenchSingleton.CallLater( TimeSpan.FromMilliseconds(currentStatus == OperationStatus.Error ? 500 : 150), new Action(DoHideProgress)); }