/// <summary> /// Change the text in the status bar. If the status bar is frozen no change is made. /// </summary> /// <param name="text">The text to display.</param> public IDisposable FreezeText(string text) { ThreadHelper.ThrowIfNotOnUIThread(); try { Statusbar.IsFrozen(out int frozen); if (!Convert.ToBoolean(frozen)) { Statusbar.GetText(out string existingText); Statusbar.SetText(text); Statusbar.FreezeOutput(Convert.ToInt32(true)); void UnfreezeText() { Statusbar.FreezeOutput(Convert.ToInt32(false)); Statusbar.SetText(existingText); } return(new Disposable(UnfreezeText)); } } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to write to the status bar: {ex.Message}"); } return(new Disposable()); }
private static void UnFreeze() { try { Statusbar.FreezeOutput(0); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to unfreeze the status bar output: {ex.Message}"); } }
private static void HideDeployAnimation() { try { object animation = (short)Constants.SBAI_Deploy; Statusbar.Animation(0, ref animation); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to hide animation: {ex.Message}"); } }
private void UnFreeze() { ThreadHelper.ThrowIfNotOnUIThread(); try { Statusbar.FreezeOutput(0); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to unfreeze the status bar output: {ex.Message}"); } }
/// <summary> /// Freezes the status bar, which prevents updates from other parts of the VS shell. /// </summary> /// <returns>An implementation of <seealso cref="IDisposable"/> that will unfreeze the status bar on dispose.</returns> public static IDisposable Freeze() { try { Statusbar.FreezeOutput(1); return(new Disposable(UnFreeze)); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to freeze the status bar output: {ex.Message}"); return(null); } }
private void HideDeployAnimation() { ThreadHelper.ThrowIfNotOnUIThread(); try { object animation = (short)Constants.SBAI_Deploy; Statusbar.Animation(0, ref animation); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to hide animation: {ex.Message}"); } }
/// <summary> /// Shows an animation to show that a deploy action is being executed. This animation will only show /// if VS is showing all of the visual effects. The result of the method should stored in a variable in a /// using statement. /// </summary> /// <returns>An implementation of <seealso cref="IDisposable"/> that will stop the animation on dispose.</returns> public static IDisposable ShowDeployAnimation() { try { object animation = (short)Constants.SBAI_Deploy; Statusbar.Animation(1, ref animation); return(new Disposable(HideDeployAnimation)); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to show animation: {ex.Message}"); return(null); } }
/// <summary> /// Change the text in the status bar. If the status bar is frozen no change is made. /// </summary> /// <param name="text">The text to display.</param> public void SetText(string text) { ThreadHelper.ThrowIfNotOnUIThread(); try { Statusbar.IsFrozen(out int frozen); if (!Convert.ToBoolean(frozen)) { Statusbar.SetText(text); } } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to write to the status bar: {ex.Message}"); } }
/// <summary> /// Change the text in the status bar. If the status bar is frozen no change is made. /// </summary> /// <param name="text">The text to display.</param> public static void SetText(string text) { try { int frozen; Statusbar.IsFrozen(out frozen); if (frozen != 0) { return; } Statusbar.SetText(text); } catch (Exception ex) { ActivityLogUtils.LogError($"Failed to write to the status bar: {ex.Message}"); } }