예제 #1
0
 /// <summary>
 /// Update UI for the PowerShellErrorRaised event
 /// </summary>
 /// <param name="arg"></param>
 private void PowerShellError(PowerShellErrorEventArg arg)
 {
     RunspaceExclamationImage.Visibility = System.Windows.Visibility.Visible;
     RunspaceStatusTextBlock.Text        = "Error";
     StatusProgress.IsIndeterminate      = false;
     errorMessage = "PowerShell Error:\r\n" + arg.PowerShellException.Message + "\r\nInner Exception: " +
                    arg.PowerShellException.InnerException;
 }
예제 #2
0
 private void _shell_PowerShellErrorRaised(object sender, PowerShellErrorEventArg arg)
 {
     Dispatcher.Invoke(() =>
     {
         StatusText.Text = "Error";
         MainWindow.ErrorDialog(arg.PowerShellException.Message);
         _shell = null;
     });
 }
예제 #3
0
 /// <summary>
 /// Trigerred when an error was catched on the PowerShell object level
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="arg"></param>
 void poshEngine_PowerShellErrorRaised(object sender, PowerShellErrorEventArg arg)
 {
     this.Dispatcher.Invoke(new Action(() => PowerShellError(arg)));
 }