Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/15 11:51:04 (9 years ago)
Author:
pfleck
Message:

#2025 Added ordering for categories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/NewItemDialog.cs

    r12504 r12506  
    9696      foreach (var category in categories) {
    9797        var fullName = category.Key;
    98         var tokens = fullName.Split(new[] { CreatableAttribute.Categories.Splitter }, StringSplitOptions.RemoveEmptyEntries);
     98        var tokensWithOrdering = fullName.Split(new[] { CreatableAttribute.Categories.SplitToken }, StringSplitOptions.RemoveEmptyEntries);
     99        var tokens = tokensWithOrdering.Select(t => t.Split(new[] { CreatableAttribute.Categories.OrderToken }, StringSplitOptions.RemoveEmptyEntries).Last()).ToList();
    99100        var name = tokens.Last();
    100         var parents = tokens.Take(tokens.Length - 1);
     101        var parents = tokensWithOrdering.Take(tokens.Count - 1);
    101102
    102103        var categoryNode = new TreeNode(name, imageIndex: 1, selectedImageIndex: 1) {
     
    118119      string fullName = null;
    119120      foreach (string parentCategory in parentCategories) {
    120         fullName = fullName == null ? parentCategory : fullName + "#" + parentCategory;
     121        fullName = fullName == null ? parentCategory : fullName + CreatableAttribute.Categories.SplitToken + parentCategory;
    121122        parentNode = node.Nodes.Find(fullName, searchAllChildren: false).SingleOrDefault();
    122123        if (parentNode == null) {
Note: See TracChangeset for help on using the changeset viewer.