forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasicClass.cs
234 lines (195 loc) · 4.5 KB
/
BasicClass.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
using System;
using System.Collections;
namespace NHibernate.DomainModel
{
[Serializable]
public class SerializableClass
{
public int classId;
public string classString;
public override int GetHashCode()
{
// not a good method, but all that is needed for this Class
// to be used by tests.
return base.GetHashCode();
}
public override bool Equals(object obj)
{
SerializableClass lhs = obj as SerializableClass;
if(lhs==null) return false;
if(this==lhs) return true;
if(this.classId.Equals(lhs.classId)
&& this.classString.Equals(this.classString)) return true;
return false;
}
}
/// <summary>
/// Summary description for BasicClass.
/// </summary>
[Serializable]
public class BasicClass
{
private int id;
private byte[] binaryProperty;
private bool booleanProperty;
private byte byteProperty;
private char characterProperty;
private System.Type classProperty;
private System.Globalization.CultureInfo cultureInfoProperty;
private DateTime dateTimeProperty;
private decimal decimalProperty;
private double doubleProperty;
private short int16Property;
private int int32Property;
private long int64Property;
private SerializableClass serializableProperty;
private float singleProperty;
private string stringProperty;
private DateTime ticksProperty;
private bool trueFalseProperty;
private bool yesNoProperty;
private string[] stringArray;
private int[] int32Array;
private IList stringBag;
private IList stringList;
private IDictionary stringMap;
private IDictionary stringSet;
private object dummyObject = new object();
public BasicClass()
{
serializableProperty = new SerializableClass();
serializableProperty.classId = 5;
serializableProperty.classString = "serialize me";
}
public int Id
{
get { return id;}
set { id = value;}
}
public byte[] BinaryProperty
{
get {return binaryProperty;}
set {binaryProperty = value;}
}
public bool BooleanProperty
{
get {return booleanProperty;}
set {booleanProperty = value;}
}
public byte ByteProperty
{
get {return byteProperty;}
set {byteProperty = value;}
}
public char CharacterProperty
{
get {return characterProperty ;}
set {characterProperty = value;}
}
public System.Type ClassProperty
{
get {return classProperty;}
set {classProperty = value;}
}
public System.Globalization.CultureInfo CultureInfoProperty
{
get {return cultureInfoProperty;}
set {cultureInfoProperty = value;}
}
public DateTime DateTimeProperty
{
get {return dateTimeProperty;}
set {dateTimeProperty = value;}
}
public decimal DecimalProperty
{
get {return decimalProperty;}
set {decimalProperty = value;}
}
public double DoubleProperty
{
get {return doubleProperty;}
set {doubleProperty = value;}
}
public short Int16Property
{
get {return int16Property;}
set {int16Property = value;}
}
public int Int32Property
{
get {return int32Property;}
set {int32Property = value;}
}
public long Int64Property
{
get {return int64Property;}
set {int64Property = value;}
}
public SerializableClass SerializableProperty
{
get {return serializableProperty;}
set {serializableProperty = value;}
}
public float SingleProperty
{
get {return singleProperty;}
set {singleProperty = value;}
}
public string StringProperty
{
get {return stringProperty;}
set {stringProperty = value;}
}
public DateTime TicksProperty
{
get {return ticksProperty;}
set {ticksProperty = value;}
}
public bool TrueFalseProperty
{
get {return trueFalseProperty;}
set {trueFalseProperty = value;}
}
public bool YesNoProperty
{
get {return yesNoProperty;}
set {yesNoProperty = value;}
}
public string[] StringArray
{
get { return stringArray; }
set { stringArray = value; }
}
public int[] Int32Array
{
get { return int32Array; }
set { int32Array = value; }
}
public IList StringBag
{
get { return stringBag; }
set { stringBag = value; }
}
public IList StringList
{
get { return stringList; }
set { stringList = value; }
}
public IDictionary StringMap
{
get { return stringMap; }
set { stringMap = value; }
}
public IDictionary StringSet
{
get { return stringSet; }
set { stringSet = value; }
}
public void AddToStringSet(string stringValue)
{
if(StringSet==null) StringSet = new Hashtable();
StringSet[stringValue] = dummyObject;
}
}
}