Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13459


Ignore:
Timestamp:
12/14/15 18:06:01 (9 years ago)
Author:
ascheibe
Message:

#2205

  • fixed another deserialization bug
  • AlgorithmNode: made locker object protected so that inherited classes that override the Execute method can use it
  • Improved responsiveness of ProgrammableItemView
Location:
branches/OptimizationNetworks
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Networks.Views/3.3/Scripting/ProgrammableItemView.cs

    r12232 r13459  
    2020#endregion
    2121
    22 using HeuristicLab.Common.Resources;
    23 using HeuristicLab.Core.Views;
    24 using HeuristicLab.MainForm;
    25 using HeuristicLab.PluginInfrastructure;
    2622using System;
    2723using System.CodeDom.Compiler;
     
    2925using System.Globalization;
    3026using System.Linq;
     27using System.Threading.Tasks;
    3128using System.Windows.Forms;
     29using HeuristicLab.Common.Resources;
     30using HeuristicLab.Core.Views;
     31using HeuristicLab.MainForm;
     32using HeuristicLab.PluginInfrastructure;
    3233
    3334namespace HeuristicLab.Scripting.Views {
     
    5556    }
    5657
    57     protected override void OnContentChanged() {
     58    protected async override void OnContentChanged() {
    5859      base.OnContentChanged();
    5960      errorsListView.Items.Clear();
     
    6364      } else {
    6465        codeEditor.UserCode = Content.Code;
    65         foreach (var asm in Content.GetAssemblies())
    66           codeEditor.AddAssembly(asm);
    67         variableStoreView.Content = Content.VariableStore;
     66        Locked = true;
     67        Task t = Task.Factory.StartNew(() => {
     68          foreach (var asm in Content.GetAssemblies())
     69            codeEditor.AddAssembly(asm);
     70          variableStoreView.Content = Content.VariableStore;
     71        });
     72        await t;
     73        Locked = false;
    6874      }
    6975      ShowCompilationResults();
     
    116122      try {
    117123        Content.Compile();
    118       } catch (Exception ex) {
     124      }
     125      catch (Exception ex) {
    119126        if (!(ex is InvalidOperationException) || (Content.CompileErrors == null))
    120127          ErrorHandling.ShowErrorDialog(this, ex);
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/AlgorithmNode.cs

    r11713 r13459  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
     24using System.Linq;
     25using System.Threading;
    2226using HeuristicLab.Common;
    2327using HeuristicLab.Core;
     
    2630using HeuristicLab.Optimization;
    2731using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System;
    29 using System.Collections.Generic;
    30 using System.Linq;
    31 using System.Threading;
    3232
    3333namespace HeuristicLab.Networks {
     
    3535  [StorableClass]
    3636  public class AlgorithmNode : Node, IAlgorithmNode {
    37     private object locker = new object();
     37    protected object locker = new object();
    3838
    3939    new public PortCollection Ports {
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Core/Network.cs

    r11577 r13459  
    2020#endregion
    2121
    22 using HeuristicLab.Common;
    23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2422using System.Collections.Generic;
    2523using System.Drawing;
    2624using System.Linq;
     25using HeuristicLab.Common;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    2828namespace HeuristicLab.Core.Networks {
     
    8484    [StorableHook(HookType.AfterDeserialization)]
    8585    private void AfterDeserialization() {
    86       foreach (var n in Nodes)
     86      foreach (var n in Nodes.ToList())
    8787        n.Parent = this;
    8888      RegisterNodesEvents();
Note: See TracChangeset for help on using the changeset viewer.