Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/StorableAttributeTests.cs @ 14711

Last change on this file since 14711 was 14711, checked in by gkronber, 7 years ago

#2520

  • renamed StorableClass -> StorableType
  • changed persistence to use GUIDs instead of type names
File size: 2.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
23
24namespace HeuristicLab.Persistence.Tests {
25
26  [StorableType("E6CE21DC-FEA3-4763-BA60-CE8EB6B8E539")]
27  class DemoClass {
28
29    [Storable(Name = "TestProperty", DefaultValue = 12)]
30    public object o = null;
31
32    [Storable]
33    public int x = 2;
34
35    public int y = 0;
36  }
37
38  [StorableType("32FDC5F4-E5AD-4119-90E0-6D14785E87FD")]
39  class Base {
40    public string baseName;
41    [Storable]
42    public virtual string Name {
43      get { return "Base"; }
44      set { baseName = value; }
45    }
46  }
47
48  [StorableType("F2151C9F-FD83-4D6F-B987-08DF723158DB")]
49  class Override : Base {
50    [Storable]
51    public override string Name {
52      get { return "Override"; }
53      set { base.Name = value; }
54    }
55  }
56
57  [StorableType("647B2E77-EC1E-458F-AB9D-ACFA8248352A")]
58  class Intermediate : Override {
59  }
60
61  [StorableType("AEAC61FF-896F-418C-82C8-33F0548AF3B2")]
62  class New : Intermediate {
63    public string newName;
64    [Storable]
65    public new string Name {
66      get { return "New"; }
67      set { newName = value; }
68    }
69  }
70}
Note: See TracBrowser for help on using the repository browser.