Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/19 18:16:20 (5 years ago)
Author:
gkronber
Message:

#2520: changed HeuristicLab.MetaOptimization addon to compile with new HL.Persistence

Location:
addons/HeuristicLab.MetaOptimization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • addons/HeuristicLab.MetaOptimization

    • Property svn:ignore
      •  

        old new  
        88HeuristicLab.MetaOptimization.sln.docstates.suo
        99_ReSharper.HeuristicLab.MetaOptimization
         10packages
  • addons/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs

    r8091 r16574  
    66using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    77using HeuristicLab.PluginInfrastructure;
     8using HEAL.Attic;
    89
    910namespace HeuristicLab.Problems.MetaOptimization {
    1011  [Item("ConstrainedTypeValue", "Represents a type with constraints.")]
    11   [StorableClass]
     12  [StorableType("4F23AEDE-E7EA-4D6D-B9B5-2CB379E9EC22")]
    1213  public class ConstrainedTypeValue : TypeValue {
    1314
    1415    private IEnumerable<Type> validTypes;
    15     public IEnumerable<Type> ValidTypes {
     16    public IEnumerable<Type> ValidTypes
     17    {
    1618      get { return validTypes; }
    1719      set { validTypes = value; }
    1820    }
    1921
    20     public override Type Value {
     22    public override Type Value
     23    {
    2124      set {
    2225        if (!ValidTypes.Contains(value)) throw new NotSupportedException("Value cannot be set. Type is not enlisted in ValidTypes");
     
    3538
    3639    [StorableConstructor]
    37     protected ConstrainedTypeValue(bool deserializing) : base(deserializing) { }
     40    protected ConstrainedTypeValue(StorableConstructorFlag _) : base(_) { }
    3841    protected ConstrainedTypeValue(ConstrainedTypeValue original, Cloner cloner)
    3942      : base(original, cloner) {
     
    4750
    4851  [Item("ConstrainedTypeValue<>", "Represents a type with constraints.")]
    49   [StorableClass]
     52  [StorableType("7757CD83-C616-4A84-99FE-34EBB5546B6D")]
    5053  public class ConstrainedTypeValue<T> : ConstrainedTypeValue where T : class, IItem {
    5154
     
    6265
    6366    [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();
    6969    }
    7070
Note: See TracChangeset for help on using the changeset viewer.