protected override void EndProcessing()
        {
            string history = "user opt-out";
            string errors  = "user opt-out";

            if (IncludeCommandHistory.IsPresent)
            {
                var o = this.SessionState.InvokeCommand.InvokeScript("get-history | convertto-xml | select -expand outerxml").FirstOrDefault();
                if (null == o)
                {
                    history = "unable to retrieve history";
                }
                else
                {
                    history = o.ToString();
                }
            }
            if (IncludeErrorHistory.IsPresent)
            {
                var o = this.SessionState.InvokeCommand.InvokeScript("$error | convertto-xml | select -expand outerxml").FirstOrDefault();
                if (null == o)
                {
                    errors = "unable to retrieve errors";
                }
                else
                {
                    errors = o.ToString();
                }
            }

            var message =
                String.Format(
                    "This issue was submitted via the Send-SeeShellIncident cmdlet.\nUser Notes: {0}",
                    Message);

            IssueReporter.ReportIssue(errors, history, message);
        }
Esempio n. 2
0
        static void RunApplication(object o)
        {
            try
            {
                _keepApplicationAlive = true;
                _application          = new Application();

                var wait = o as ManualResetEvent;
                InitializeSeeShellApplication();
                wait.Set();

                _application.ShutdownMode = ShutdownMode.OnExplicitShutdown;

                _application.Run();
                _application = null;
            }
            catch (Exception e)
            {
                var msg = "An unhandled exception has occurred in SeeShell on the main user interface thread.";
                Log.Error(msg, e);
                IssueReporter.ReportIssue(e.ToString(), null, msg);
                throw;
            }
        }