Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12238


Ignore:
Timestamp:
03/23/15 11:41:19 (10 years ago)
Author:
pfleck
Message:

#2025 Fixed bug when filtering nodes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs

    r12235 r12238  
    197197
    198198        // select first item
    199         if (selectedType == null) {
     199        if (SelectedType == null) {
    200200          var firstNode = FirstVisibleNode;
    201201          while (firstNode != null && !(firstNode.Tag is Type))
     
    217217
    218218    private bool FilterNode(TreeNode node, string[] searchTokens) {
    219       if (node.Tag is string) {
     219      if (node.Tag is string) { // Category node
    220220        int i = 0;
    221221        while (i < node.Nodes.Count) {
     
    226226        }
    227227        return node.Nodes.Count == 0;
    228       } else if (node.Tag is Type) {
     228      }
     229      if (node.Tag is Type) { // Type node
    229230        var text = node.Text;
    230231        if (searchTokens.Any(searchToken => !text.ToLower().Contains(searchToken))) {
    231232          var typeTag = (Type)node.Tag;
    232           if (typeTag.Equals(SelectedType))
     233          if (typeTag.Equals(SelectedType)) {
    233234            SelectedType = null;
     235            typesTreeView.SelectedNode = null;
     236          }
    234237          return true;
    235238        }
    236239        return false;
    237       } else {
    238         return true;
    239       }
     240      }
     241      return true;
    240242    }
    241243
Note: See TracChangeset for help on using the changeset viewer.