public static void WriteToOutputWindow(string message, Enums.MessageType messageType)
        {
            message = $"{messageType.ToString().ToUpper()} | {DateTime.Now:G}: {message}";
            message = Environment.NewLine + message;

            var guidPane = VSConstants.OutputWindowPaneGuid.GeneralPane_guid;

            if (!(Package.GetGlobalService(typeof(SVsOutputWindow)) is IVsOutputWindow outputWindow))
            {
                Logger.Error(Resource.ErrorMessage_ErrorGettingOutputWindow);
                return;
            }

            if (guidPane == VSConstants.OutputWindowPaneGuid.GeneralPane_guid)
            {
                outputWindow.CreatePane(guidPane, Resource.OutputLoggerWindowTitle, 1, 1);
            }

            outputWindow.GetPane(guidPane, out var outputWindowPane);

            if (outputWindowPane == null)
            {
                return;
            }

            outputWindowPane.Activate();
            outputWindowPane.OutputString(message);

            //This would bring the output window into focus
            //using EnvDTE;
            //DTE dte = (DTE)Package.GetGlobalService(typeof(DTE));
            //dte.ExecuteCommand("View.Output", string.Empty);
        }
        public static void WriteToOutputWindow(string message, Enums.MessageType messageType)
        {
            message = $"{messageType.ToString().ToUpper()} | {DateTime.Now:G}: {message}";
            message = Environment.NewLine + message;

            _customPane.OutputString(message);
            _customPane.Activate();
        }
예제 #3
0
        public static MvcHtmlString ZN_Message(this HtmlHelper htmlHelper, Enums.MessageType messageType, string message)
        {
            TagBuilder tagResult = new TagBuilder("div");

            tagResult.MergeAttribute("class", string.Format("alert alert-{0}", messageType.ToString().ToLower()));
            tagResult.MergeAttribute("role", "alert");
            tagResult.InnerHtml += message;
            return(tagResult.ToHtml());
        }
예제 #4
0
 /// <summary>
 /// Log event message handeling
 /// </summary>
 void DrutNETBase_OnUpdateLog(string str, string mSender, Enums.MessageType mType, bool verbose)
 {
     // Write log messages on error window.
     richTextBox_messages.Text = mType.ToString() + " - " + mSender + ": " + str + richTextBox_messages.Text;
 }
예제 #5
0
 /// <summary>
 /// Shows the message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="messageType">The type.</param>
 public void ShowMessage(string message, Enums.MessageType messageType = Enums.MessageType.Success)
 {
     this.TempData["Message"]     = message;
     this.TempData["MessageType"] = messageType.ToString().ToLower();
 }