Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16526 for trunk


Ignore:
Timestamp:
01/10/19 11:59:30 (6 years ago)
Author:
jkarder
Message:

#2982: registered and deregistered item_ToStringChanged accordingly

File:
1 edited

Legend:

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

    r15583 r16526  
    9090      Content.ItemsRemoved -= Content_ItemsRemoved;
    9191      Content.CollectionReset -= Content_CollectionReset;
     92
     93      foreach (var variable in Content) {
     94        var item = variable.Value as IItem;
     95        if (item != null) item.ToStringChanged -= item_ToStringChanged;
     96      }
     97
    9298      base.DeregisterContentEvents();
    9399    }
    94100    protected override void RegisterContentEvents() {
    95101      base.RegisterContentEvents();
     102
    96103      Content.ItemsAdded += Content_ItemsAdded;
    97104      Content.ItemsReplaced += Content_ItemsReplaced;
    98105      Content.ItemsRemoved += Content_ItemsRemoved;
    99106      Content.CollectionReset += Content_CollectionReset;
     107
     108      foreach (var variable in Content) {
     109        var item = variable.Value as IItem;
     110        if (item != null) item.ToStringChanged += item_ToStringChanged;
     111      }
    100112    }
    101113
Note: See TracChangeset for help on using the changeset viewer.