Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/15 14:32:00 (9 years ago)
Author:
jkarder
Message:

#2077:

  • changed error and warning markup handling
  • minor code changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs

    r11834 r11836  
    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    }
Note: See TracChangeset for help on using the changeset viewer.