Changeset 11819


Ignore:
Timestamp:
01/23/15 12:27:42 (5 years ago)
Author:
jkarder
Message:

#2077:

  • added temporary fix to avoid crash trough code completion
  • fixed updating of compilation succeeded/failed messages
  • added Keys and Values properties to the Variables class (again)
Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpOverloadProvider.cs

    r11700 r11819  
    115115
    116116      int parameterIndex = pce.GetCurrentParameterIndex(startOffset, completionContext.Offset);
    117       if (parameterIndex < 0) {
     117      if (parameterIndex < 0 || !items.Any()) {
    118118        RequestClose = true;
    119119        return;
  • trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs

    r11807 r11819  
    3838  [Content(typeof(Script), true)]
    3939  public partial class ScriptView : NamedItemView {
     40    private const string NotCompiledMessage = "Not compiled";
     41    private const string CompilationSucceededMessage = "Compilation succeeded";
     42    private const string CompilationFailedMessage = "Compilation failed";
    4043    private const string AssembliesLoadingMessage = "Loading Assemblies";
    4144    private const string AssembliesUnloadingMessage = "Unloading Assemblies";
     
    8487        if (Content.CompileErrors == null) {
    8588          compilationLabel.ForeColor = SystemColors.ControlDarkDark;
    86           compilationLabel.Text = "Not compiled";
    87         } else if (Content.CompileErrors.HasErrors) {
    88           compilationLabel.ForeColor = Color.DarkRed;
    89           compilationLabel.Text = "Compilation failed";
    90         } else {
    91           compilationLabel.ForeColor = Color.DarkGreen;
    92           compilationLabel.Text = "Compilation successful";
     89          compilationLabel.Text = NotCompiledMessage;
    9390        }
    9491      }
     
    119116      try {
    120117        Content.Compile();
    121         outputTextBox.AppendText("Compilation succeeded.");
     118        outputTextBox.AppendText(CompilationSucceededMessage);
     119        compilationLabel.ForeColor = Color.DarkGreen;
     120        compilationLabel.Text = CompilationSucceededMessage;
    122121        return true;
    123122      } catch (InvalidOperationException) {
    124123        if (Content.CompileErrors.HasErrors) {
    125           outputTextBox.AppendText("Compilation failed.");
     124          outputTextBox.AppendText(CompilationFailedMessage);
     125          compilationLabel.ForeColor = Color.DarkRed;
     126          compilationLabel.Text = CompilationFailedMessage;
    126127          return false;
    127128        } else {
    128           outputTextBox.AppendText("Compilation succeeded.");
     129          outputTextBox.AppendText(CompilationSucceededMessage);
     130          compilationLabel.ForeColor = Color.DarkGreen;
     131          compilationLabel.Text = CompilationSucceededMessage;
    129132          return true;
    130133        }
  • trunk/sources/HeuristicLab.Scripting/3.3/Variables.cs

    r11135 r11819  
    66  public class Variables : DynamicObject, IEnumerable<KeyValuePair<string, object>> {
    77    private readonly VariableStore variableStore;
     8
     9    public IEnumerable<string> Keys {
     10      get { return variableStore.Keys; }
     11    }
     12
     13    public IEnumerable<object> Values {
     14      get { return variableStore.Values; }
     15    }
    816
    917    public Variables(VariableStore variableStore) {
Note: See TracChangeset for help on using the changeset viewer.