- Timestamp:
- 03/24/15 11:07:36 (10 years ago)
- Location:
- branches/NewItemDialog
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NewItemDialog/HeuristicLab.Core/3.3/Attributes/CreatableAttribute.cs
r12012 r12246 36 36 } 37 37 38 public int Priority { get; set; } 39 40 38 41 public CreatableAttribute() { 39 42 Category = "Other Items"; 43 Priority = int.MaxValue; 40 44 } 41 45 public CreatableAttribute(string category) … … 53 57 else return null; 54 58 } 59 60 public static int GetPriority(Type type) { 61 var attribs = type.GetCustomAttributes(typeof(CreatableAttribute), false); 62 if (attribs.Length > 0) return ((CreatableAttribute)attribs[0]).Priority; 63 else return int.MaxValue; 64 } 55 65 } 56 66 } -
branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
r12239 r12246 67 67 let category = CreatableAttribute.GetCategory(type) 68 68 let name = ItemAttribute.GetName(type) 69 let priority = CreatableAttribute.GetPriority(type) 69 70 let version = ItemAttribute.GetVersion(type) 70 71 where CreatableAttribute.IsCreatable(type) 71 orderby category, name, version ascending72 orderby category, priority, name, version ascending 72 73 group type by category into categoryGroup 73 74 select categoryGroup;
Note: See TracChangeset
for help on using the changeset viewer.