Changeset 11944


Ignore:
Timestamp:
02/06/15 14:09:26 (7 years ago)
Author:
abeham
Message:

#2174:

  • Made it more visible that the problem definition needs to be recompiled.
  • Added protocol buffer tools (can be deleted before trunk integration)
Location:
branches/ProgrammableProblem
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable.Views/3.3/ProblemDefinitionScriptView.cs

    r11885 r11944  
    5858      return true;
    5959    }
     60
     61    protected override void Content_CodeChanged(object sender, EventArgs e) {
     62      base.Content_CodeChanged(sender, e);
     63      UpdateInfoTextLabel("Code changed, compilation necessary!", Color.Red);
     64    }
    6065  }
    6166}
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/Scripts/ProblemDefinitionScript.cs

    r11900 r11944  
    4040    }
    4141
     42    [Storable]
     43    private bool codeChanged;
     44
    4245    [StorableConstructor]
    4346    protected ProblemDefinitionScript(bool deserializing) : base(deserializing) { }
     
    4548      : base(original, cloner) {
    4649      variableStore = cloner.Clone(original.variableStore);
     50      codeChanged = original.codeChanged;
    4751    }
    4852    protected ProblemDefinitionScript()
     
    6367          lock (compileLock) {
    6468            if (compiledProblemDefinition == null) {
     69              if (codeChanged) throw new ProblemDefinitionScriptException("The code has been changed, but was not recompiled.");
    6570              Compile(false);
    6671            }
     
    7580    }
    7681
    77     protected virtual Assembly Compile(bool fireChanged) {
     82    private Assembly Compile(bool fireChanged) {
    7883      var assembly = base.Compile();
    7984      var types = assembly.GetTypes();
     
    107112      }
    108113
     114      codeChanged = false;
    109115      return assembly;
    110116    }
     
    113119      base.OnCodeChanged();
    114120      compiledProblemDefinition = null;
     121      codeChanged = true;
    115122    }
    116123
Note: See TracChangeset for help on using the changeset viewer.