Changeset 12506


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

#2025 Added ordering for categories.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Attributes/CreatableAttribute.cs

    r12504 r12506  
    2727    #region Predefined Categories
    2828    public static class Categories {
    29       public const string Splitter = "###";
     29      public const string SplitToken = "###";
     30      public const string OrderToken = "$$$";
    3031
    31       public const string Algorithms = "Algorithms";
    32       public const string PopulationBasedAlgorithms = Algorithms + Splitter + "Population Based";
    33       public const string SingleSolutionAlgorithms = Algorithms + Splitter + "Single Solution";
     32      public const string Algorithms = "1" + OrderToken + "Algorithms";
     33      public const string PopulationBasedAlgorithms = Algorithms + SplitToken + "1" + OrderToken + "Population Based";
     34      public const string SingleSolutionAlgorithms = Algorithms + SplitToken + "2" + OrderToken + "Single Solution";
    3435
    35       public const string Problems = "Problems";
    36       public const string CombinatorialProblems = Problems + Splitter + "Combinatorial";
    37       public const string GeneticProgrammingProblems = Problems + Splitter + "Genetic Programming";
    38       public const string ExternalEvaluationProblems = Problems + Splitter + "External Evaluation";
     36      public const string Problems = "2" + OrderToken + "Problems";
     37      public const string CombinatorialProblems = Problems + SplitToken + "1" + OrderToken + "Combinatorial";
     38      public const string GeneticProgrammingProblems = Problems + SplitToken + "2" + OrderToken + "Genetic Programming";
     39      public const string ExternalEvaluationProblems = Problems + SplitToken + "3" + OrderToken + "External Evaluation";
    3940
    40       public const string DataAnalysis = "Data Analysis";
    41       public const string DataAnalysisClassification = DataAnalysis + Splitter + "Classification";
    42       public const string DataAnalysisRegression = DataAnalysis + Splitter + "Regression";
    43       public const string DataAnalysisEnsembles = DataAnalysis + Splitter + "Ensembles";
     41      public const string DataAnalysis = "3" + OrderToken + "Data Analysis";
     42      public const string DataAnalysisRegression = DataAnalysis + SplitToken + "1" + OrderToken + "Regression";
     43      public const string DataAnalysisClassification = DataAnalysis + SplitToken + "2" + OrderToken + "Classification";
     44      public const string DataAnalysisEnsembles = DataAnalysis + SplitToken + "3" + OrderToken + "Ensembles";
    4445
    45       public const string TestingAndAnalysis = "Testing & Analysis";
    46       public const string TestingAndAnalysisOKB = TestingAndAnalysis + Splitter + "OKB";
     46      public const string TestingAndAnalysis = "4" + OrderToken + "Testing & Analysis";
     47      public const string TestingAndAnalysisOKB = TestingAndAnalysis + SplitToken + "1" + OrderToken + "OKB";
    4748
    48       public const string Scripts = "5 - Scripts";
     49      public const string Scripts = "5" + OrderToken + "Scripts";
     50
     51
    4952    }
    5053    #endregion
  • 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.