Changeset 14100 for trunk/sources/HeuristicLab.Optimization
- Timestamp:
- 07/18/16 16:39:09 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/Results/ResultParameter.cs
r14071 r14100 33 33 public sealed class ResultParameter<T> : LookupParameter<T>, IResultParameter<T> where T : class, IItem { 34 34 public override Image ItemImage { get { return VSImageLibrary.Exception; } } 35 public override bool CanChangeDescription { get { return true; } } 35 36 36 37 [Storable] … … 71 72 } 72 73 public ResultParameter() : this("Anonymous", string.Empty, "Results") { } 73 public ResultParameter(string name) : this(name, string.Empty, "Results") { }74 74 public ResultParameter(string name, string description) : this(name, description, "Results") { } 75 75 76 public ResultParameter(string name, string description, string resultCollectionName) 76 77 : base(name, description, string.Empty) { 77 78 if (string.IsNullOrEmpty(resultCollectionName)) throw new ArgumentException("resultCollectionName"); 78 79 this.resultCollectionName = resultCollectionName; 80 Hidden = false; 79 81 } 80 82 public ResultParameter(string name, string description, string resultCollectionName, T defaultValue) … … 84 86 this.resultCollectionName = resultCollectionName; 85 87 this.defaultValue = defaultValue; 88 Hidden = false; 86 89 } 87 90 … … 102 105 if (!results.TryGetValue(ActualName, out result)) { 103 106 if (DefaultValue == null) throw new InvalidOperationException("ResultParameter (" + ActualName + "): Result not found and no default value specified."); 104 result = new Result(ActualName, (T)DefaultValue.Clone());107 result = ItemDescription == Description ? new Result(ActualName, (T)DefaultValue.Clone()) : new Result(ActualName, Description, (T)DefaultValue.Clone()); 105 108 results.Add(result); 106 109 } … … 127 130 IResult result; 128 131 if (!results.TryGetValue(ActualName, out result)) { 129 result = new Result(ActualName, value);132 result = ItemDescription == Description ? new Result(ActualName, value) : new Result(ActualName, Description, value); 130 133 results.Add(result); 131 134 } else result.Value = value;
Note: See TracChangeset
for help on using the changeset viewer.