Changeset 16574 for addons/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs
- Timestamp:
- 01/28/19 18:16:20 (5 years ago)
- Location:
- addons/HeuristicLab.MetaOptimization
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
addons/HeuristicLab.MetaOptimization
- Property svn:ignore
-
old new 8 8 HeuristicLab.MetaOptimization.sln.docstates.suo 9 9 _ReSharper.HeuristicLab.MetaOptimization 10 packages
-
- Property svn:ignore
-
addons/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs
r8091 r16574 6 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 using HeuristicLab.PluginInfrastructure; 8 using HEAL.Attic; 8 9 9 10 namespace HeuristicLab.Problems.MetaOptimization { 10 11 [Item("ConstrainedTypeValue", "Represents a type with constraints.")] 11 [Storable Class]12 [StorableType("4F23AEDE-E7EA-4D6D-B9B5-2CB379E9EC22")] 12 13 public class ConstrainedTypeValue : TypeValue { 13 14 14 15 private IEnumerable<Type> validTypes; 15 public IEnumerable<Type> ValidTypes { 16 public IEnumerable<Type> ValidTypes 17 { 16 18 get { return validTypes; } 17 19 set { validTypes = value; } 18 20 } 19 21 20 public override Type Value { 22 public override Type Value 23 { 21 24 set { 22 25 if (!ValidTypes.Contains(value)) throw new NotSupportedException("Value cannot be set. Type is not enlisted in ValidTypes"); … … 35 38 36 39 [StorableConstructor] 37 protected ConstrainedTypeValue( bool deserializing) : base(deserializing) { }40 protected ConstrainedTypeValue(StorableConstructorFlag _) : base(_) { } 38 41 protected ConstrainedTypeValue(ConstrainedTypeValue original, Cloner cloner) 39 42 : base(original, cloner) { … … 47 50 48 51 [Item("ConstrainedTypeValue<>", "Represents a type with constraints.")] 49 [Storable Class]52 [StorableType("7757CD83-C616-4A84-99FE-34EBB5546B6D")] 50 53 public class ConstrainedTypeValue<T> : ConstrainedTypeValue where T : class, IItem { 51 54 … … 62 65 63 66 [StorableConstructor] 64 protected ConstrainedTypeValue(bool deserializing) 65 : base(deserializing) { 66 if (deserializing) { 67 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 68 } 67 protected ConstrainedTypeValue(StorableConstructorFlag _) : base(_) { 68 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 69 69 } 70 70
Note: See TracChangeset
for help on using the changeset viewer.