public static void UpdateQueryStatus() { // Force the shell to refresh the QueryStatus for all the command since some of them may have been flagged as // not supported (because the host had focus but the view did not) and switching focus from the zoom control // back to the view will not automatically force the shell to requery for the command status. VsUIShell?.UpdateCommandUI(0); }
public override void OnToolWindowCreated() { // Register key bindings to use in the editor var windowFrame = (IVsWindowFrame)Frame; Guid cmdUi = VSConstants.GUID_TextEditorFactory; windowFrame.SetGuidProperty((int)__VSFPROPID.VSFPROPID_InheritKeyBindings, ref cmdUi); // refresh PMC UI to update default project name after solution load completed. SolutionManager.SolutionOpened += (o, e) => { VsUIShell.UpdateCommandUI(0); }; // pause for a tiny moment to let the tool window open before initializing the host var timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(10); timer.Tick += (o, e) => { // all exceptions from the timer thread should be caught to avoid crashing VS try { LoadConsoleEditor(); timer.Stop(); } catch (Exception x) { ExceptionHelper.WriteErrorToActivityLog(x); } }; timer.Start(); base.OnToolWindowCreated(); }
private void OnDispatcherStartCompleted() { ConsoleParentPane.NotifyInitializationCompleted(); // force the UI to update the toolbar VsUIShell.UpdateCommandUI(0 /* false = update UI asynchronously */); }
private void SetExecutionMode(bool isExecuting) { if (!isExecuting) { HideProgress(); VsUIShell.UpdateCommandUI(0 /* false = update UI asynchronously */); } }
private void OnDispatcherStartCompleted() { WpfConsole.Dispatcher.StartWaitingKey -= OnDispatcherStartWaitingKey; ConsoleParentPane.NotifyInitializationCompleted(); // force the UI to update the toolbar VsUIShell.UpdateCommandUI(0 /* false = update UI asynchronously */); NuGetEventTrigger.Instance.TriggerEvent(NuGetEvent.PackageManagerConsoleLoaded); }
public void SetExecutionMode(bool isExecuting) { _consoleStatus.SetBusyState(isExecuting); if (!isExecuting) { HideProgress(); VsUIShell.UpdateCommandUI(0 /* false = update UI asynchronously */); } }
private void OnDispatcherStartCompleted() { WpfConsole.Dispatcher.StartWaitingKey -= OnDispatcherStartWaitingKey; ConsoleParentPane.NotifyInitializationCompleted(); NuGetUIThreadHelper.JoinableTaskFactory.Run(async() => { await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); // force the UI to update the toolbar VsUIShell.UpdateCommandUI(0 /* false = update UI asynchronously */); }); NuGetEventTrigger.Instance.TriggerEvent(NuGetEvent.PackageManagerConsoleLoaded); }