Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 12:44:09 (9 years ago)
Author:
jkarder
Message:

#2077: merged r11807:11811, r11816, r11819, r11822, r11825, r11834, r11835, r11836, r11933 and r11936 into stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs

    r11907 r11937  
    2121
    2222using System;
     23using System.Drawing;
     24using System.Threading;
    2325using System.Windows.Forms;
    2426using HeuristicLab.Common;
     
    3133  [Content(typeof(CSharpScript), true)]
    3234  public partial class CSharpScriptView : ScriptView {
     35    private const string ScriptExecutionStartedMessage = "Script execution started";
     36    private const string ScriptExecutionCanceledMessage = "Script execution canceled";
     37    private const string ScriptExecutionSuccessfulMessage = "Script execution successful";
     38    private const string ScriptExecutionFailedMessage = "Script execution failed";
     39
    3340    protected bool Running { get; set; }
    3441
     
    6572        startStopButton.Image = VSImageLibrary.Stop;
    6673        toolTip.SetToolTip(startStopButton, "Stop (Shift+F5)");
     74        UpdateInfoTextLabel(ScriptExecutionStartedMessage, SystemColors.ControlText);
    6775        infoTabControl.SelectedTab = outputTabPage;
    6876      }
     
    7684        startStopButton.Image = VSImageLibrary.Play;
    7785        toolTip.SetToolTip(startStopButton, "Run (F5)");
     86
     87        var ex = e.Value;
     88        if (ex == null) {
     89          UpdateInfoTextLabel(ScriptExecutionSuccessfulMessage, Color.DarkGreen);
     90        } else if (ex is ThreadAbortException) {
     91          // the execution was canceled by the user
     92          UpdateInfoTextLabel(ScriptExecutionCanceledMessage, Color.DarkOrange);
     93        } else {
     94          UpdateInfoTextLabel(ScriptExecutionFailedMessage, Color.DarkRed);
     95          PluginInfrastructure.ErrorHandling.ShowErrorDialog(this, ex);
     96        }
     97
    7898        Running = false;
    79         var ex = e.Value;
    80         if (ex != null)
    81           PluginInfrastructure.ErrorHandling.ShowErrorDialog(this, ex);
    8299      }
    83100    }
     
    111128        if (Compile()) {
    112129          outputTextBox.Clear();
     130          Running = true;
    113131          Content.ExecuteAsync();
    114           Running = true;
    115132        }
    116133    }
Note: See TracChangeset for help on using the changeset viewer.