Changeset 7153 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs
- Timestamp:
- 12/07/11 21:09:40 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs
r5337 r7153 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using System.Text;4 using HeuristicLab.Common; 5 5 using HeuristicLab.Core; 6 using HeuristicLab.Data;7 using System.Drawing;8 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 using HeuristicLab.Common;10 7 using HeuristicLab.PluginInfrastructure; 11 8 … … 15 12 public class ConstrainedTypeValue : TypeValue { 16 13 17 [Storable]18 14 private IEnumerable<Type> validTypes; 19 15 public IEnumerable<Type> ValidTypes { … … 29 25 } 30 26 31 public ConstrainedTypeValue() : base() { 27 public ConstrainedTypeValue() 28 : base() { 32 29 this.readOnly = false; 33 30 } 34 public ConstrainedTypeValue(Type value) : this() { 31 public ConstrainedTypeValue(Type value) 32 : this() { 35 33 this.Value = value; 36 34 } … … 51 49 public class ConstrainedTypeValue<T> : ConstrainedTypeValue where T : class, IItem { 52 50 53 public ConstrainedTypeValue() : base() { 51 public ConstrainedTypeValue() 52 : base() { 54 53 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 55 54 this.Value = ValidTypes.First(); 56 55 } 57 public ConstrainedTypeValue(Type value) : base() { 56 public ConstrainedTypeValue(Type value) 57 : base() { 58 58 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 59 59 this.Value = value; 60 60 } 61 61 62 [StorableConstructor] 62 protected ConstrainedTypeValue(bool deserializing) : base(deserializing) { } 63 protected ConstrainedTypeValue(bool deserializing) 64 : base(deserializing) { 65 if (deserializing) { 66 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 67 } 68 } 69 63 70 protected ConstrainedTypeValue(ConstrainedTypeValue original, Cloner cloner) : base(original, cloner) { } 64 71 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.