LogError() public static method

Logs an error entry into the log.
public static LogError ( string entry ) : void
entry string The log entry.
return void
コード例 #1
0
        /// <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());
        }
コード例 #2
0
 private static void UnFreeze()
 {
     try
     {
         Statusbar.FreezeOutput(0);
     }
     catch (Exception ex)
     {
         ActivityLogUtils.LogError($"Failed to unfreeze the status bar output: {ex.Message}");
     }
 }
コード例 #3
0
 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}");
     }
 }
コード例 #4
0
 private void UnFreeze()
 {
     ThreadHelper.ThrowIfNotOnUIThread();
     try
     {
         Statusbar.FreezeOutput(0);
     }
     catch (Exception ex)
     {
         ActivityLogUtils.LogError($"Failed to unfreeze the status bar output: {ex.Message}");
     }
 }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
 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}");
     }
 }
コード例 #7
0
 /// <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);
     }
 }
コード例 #8
0
 /// <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}");
     }
 }
コード例 #9
0
 /// <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}");
     }
 }