Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/01/10 16:40:24 (14 years ago)
Author:
gkronber
Message:

Fixed problems in persistence and cloning of functions and function libraries. Added test-functionality to editor for function libraries. Fixed bugs in editor for function libraries. #748 (FunctionLibraryView is empty)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP/3.3/FunctionView.cs

    r2728 r2729  
    187187        if (subFunctionsListBox.SelectedItems.Count > 0 && e.KeyCode == Keys.Delete) {
    188188          if (selectedSlot == ALL_SLOTS) {
     189            List<IFunction> removedSubFunctions = new List<IFunction>(subFunctionsListBox.SelectedItems.Cast<IFunction>());
    189190            for (int slot = 0; slot < function.MaxSubTrees; slot++) {
    190               foreach (var subFun in subFunctionsListBox.SelectedItems) {
     191              foreach (var subFun in removedSubFunctions) {
    191192                function.RemoveAllowedSubFunction((IFunction)subFun, slot);
    192193              }
     
    194195          } else {
    195196            int slot = int.Parse(selectedSlot);
    196             foreach (var subFun in subFunctionsListBox.SelectedItems) {
    197               function.RemoveAllowedSubFunction((IFunction)subFun, slot);
     197            List<IFunction> removedSubFunctions = new List<IFunction>(subFunctionsListBox.SelectedItems.Cast<IFunction>());
     198            foreach (var subFun in removedSubFunctions) {
     199              function.RemoveAllowedSubFunction(subFun, slot);
    198200            }
    199201          }
Note: See TracChangeset for help on using the changeset viewer.