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)); }
void OnFileChangedEvent(object sender, FileSystemEventArgs e) { LoggingService.Debug("Project file " + e.Name + " was changed externally: {1}" + e.ChangeType); if (!wasChangedExternally) { wasChangedExternally = true; if (WorkbenchSingleton.Workbench.IsActiveWindow) { // delay reloading message a bit, prevents showing two messages // when the file changes twice in quick succession; and prevents // trying to reload the file while it is still being written WorkbenchSingleton.CallLater(TimeSpan.FromSeconds(0.5), delegate { MainFormActivated(this, EventArgs.Empty); }); } } }
void FileChanged(object sender, FileSystemEventArgs e) { if (!alreadyCalled) { alreadyCalled = true; LoggingService.Info(e.Name + " changed!" + e.ChangeType); if (WorkbenchSingleton.Workbench.IsActiveWindow) { WorkbenchSingleton.CallLater( TimeSpan.FromSeconds(2), () => { MainWindowActivated(this, EventArgs.Empty); } ); } } }
void DisplayCaretHighlightAnimation() { TextArea textArea = Adapter.GetService(typeof(TextArea)) as TextArea; if (textArea == null) { return; } AdornerLayer layer = AdornerLayer.GetAdornerLayer(textArea.TextView); CaretHighlightAdorner adorner = new CaretHighlightAdorner(textArea); layer.Add(adorner); WorkbenchSingleton.CallLater(TimeSpan.FromSeconds(1), (Action)(() => layer.Remove(adorner))); }
void FileChanged(object sender, FileSystemEventArgs e) { if (!alreadyCalled) { if (e.Name.EndsWith(".lock", StringComparison.OrdinalIgnoreCase)) { return; } alreadyCalled = true; LoggingService.Info(e.Name + " changed!" + e.ChangeType); if (WorkbenchSingleton.Workbench.IsActiveWindow) { WorkbenchSingleton.CallLater( TimeSpan.FromSeconds(2), () => { MainWindowActivated(this, EventArgs.Empty); } ); } } }
void OnFileChangedEvent(object sender, FileSystemEventArgs e) { if (file == null) { return; } LoggingService.Debug("File " + file.FileName + " was changed externally: " + e.ChangeType); if (!wasChangedExternally) { wasChangedExternally = true; if (WorkbenchSingleton.Workbench.IsActiveWindow) { // delay reloading message a bit, prevents showing two messages // when the file changes twice in quick succession; and prevents // trying to reload the file while it is still being written WorkbenchSingleton.CallLater( 500, delegate { MainForm_Activated(this, EventArgs.Empty); }); } } }