Пример #1
0
    public override void ReportScriptResult(String file, Exception ex)
    {
        //Debug.WriteLine("Started from: " + Assembly.GetExecutingAssembly().FullName);
        ErrorListProvider errList = ScriptHost.GetUserObject <ErrorListProvider>(ScriptHost.mainArg);

        var dte  = GetDTE();
        var pane = GetOutputPanel();

        pane.Clear();

        String msg;

        if (ex != null)
        {
            msg = ex.Message.ToString();

            // Just in case if developer is intrested to fix this.
            Debug.WriteLine(msg);

            // Bring into front in case of errors, otherwise don't activate window
            dte.ToolWindows.OutputWindow.Parent.AutoHides = false;
            dte.ToolWindows.OutputWindow.Parent.Activate();
        }
        else
        {
            msg = file + "(1): info: compiled & executed successfully\r\n";
        }

        pane.OutputString(msg);
        pane.Activate();
    }