Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/StorableAttributeTests.cs @ 17932

Last change on this file since 17932 was 17181, checked in by swagner, 5 years ago

#2875: Merged r17180 from trunk to stable

File size: 2.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 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 HEAL.Attic;
23
24namespace HeuristicLab.Persistence.Tests {
25
26  [StorableType("EF55A82D-7D9B-486E-B811-4DCC389FDB05")]
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    [StorableConstructor]
38    protected DemoClass(StorableConstructorFlag _) {
39    }
40    public DemoClass() {
41    }
42  }
43
44  [StorableType("31F18F9A-C25D-449D-900A-FEBF95D7CE39")]
45  class Base {
46    public string baseName;
47    [Storable]
48    public virtual string Name {
49      get { return "Base"; }
50      set { baseName = value; }
51    }
52
53    [StorableConstructor]
54    protected Base(StorableConstructorFlag _) {
55    }
56    public Base() {
57    }
58  }
59
60  [StorableType("DF26C284-08C4-4703-A1A4-AFE834079B85")]
61  class Override : Base {
62    [Storable]
63    public override string Name {
64      get { return "Override"; }
65      set { base.Name = value; }
66    }
67
68    [StorableConstructor]
69    protected Override(StorableConstructorFlag _) : base(_) {
70    }
71    public Override() {
72    }
73  }
74
75  [StorableType("6BFB1984-6670-4D5E-AEAC-3E77C627AF98")]
76  class Intermediate : Override {
77    [StorableConstructor]
78    protected Intermediate(StorableConstructorFlag _) : base(_) {
79    }
80    public Intermediate() {
81    }
82  }
83
84  [StorableType("856F9BDB-A20C-4B80-981B-5B4F5188FBCD")]
85  class New : Intermediate {
86    public string newName;
87    [Storable]
88    public new string Name {
89      get { return "New"; }
90      set { newName = value; }
91    }
92
93    [StorableConstructor]
94    protected New(StorableConstructorFlag _) : base(_) {
95    }
96    public New() {
97    }
98  }
99}
Note: See TracBrowser for help on using the repository browser.