blob: dfa9e52a62b3f4f8c7a40aba0d3e77b9dfb9645b (
plain)
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
|
namespace WindowsApplicationProve
{
namespace Cxxx
{
[Serializable]
public struct OtherStruct
{
public int FInt;
}
[Serializable]
public struct StructSample
{
public int FInt;
public char FChar;
public object FObj;
}
[Serializable]
public enum EnumSample
{
aa,
bb,
cc
}
[Serializable]
public delegate int DelegateProve(int i);
[Serializable]
public delegate void OtherDelegate();
public interface ISample
{
int FirstMethod(char charParam);
}
[Serializable]
public class cIntProve: ISample
{
public long FLongField;
public int FirstMethod(char charParam)
{
return 6;
}
}
public delegate string DlgProve(int i);
[Serializable]
public class cAgregationClass:BaseClass
{
public Char FCharField;
public string FStr;
public cSerializableProve Fobj;
public ISample Fintf;
//public int[][] FIntList;
public string DlgCatcher(int i)
{
return "Hello";
}
}
[Serializable]
public class BaseClass
{
public int FBaseint;
public cIntProve FIntObj;
}
[Serializable]
public class cXXX
{
public int FI;
}
[Serializable]
public class cSerializableProve
{
public object[] FArrayProve;
public object[] FNullArray;
//public ClassProve FOtherAssObj;
public cAgregationClass FAggField;
//value types
public DelegateProve FDelegateProve;
public event OtherDelegate FEventField;
public ISample FInterfaceField;
public string FStrField;
private int FPintField;
public int FIntField;
public uint FUintField;
public short FShortField;
public ushort FUShortField;
public long FLongField;
public ulong FULongField;
public bool FBoolField;
public double FDoubleField;
public decimal FDecimalField;
public char FCharField;
public StructSample FStructField;
public EnumSample FEnumField;
public cSerializableProve()
{
InitReferences();
InitSimpleTypes();
InitStructs();
InitArray();
}
private void InitReferences()
{
FAggField = new cAgregationClass();
FAggField.FCharField = 'a';
FAggField.FBaseint = 10;
FAggField.Fobj= this;
FAggField.FStr= "Hhhh";
FStrField= FAggField.FStr;
FAggField.FIntObj= new cIntProve ();
FInterfaceField= FAggField.FIntObj;
FAggField.Fintf= FInterfaceField;
}
private void InitSimpleTypes()
{
FArrayProve= new Object[20];
FPintField= 10;
FIntField = 6;
FUintField = 6;
FShortField = 6;
FUShortField = 6;
FLongField = 6;
FULongField = 6;
FDoubleField = 6;
FDecimalField = 5;
FBoolField = true;
FCharField = 'a';
FEnumField = EnumSample.aa;
}
private void InitStructs()
{
FStructField= new StructSample();
FStructField.FChar= 'a';
FStructField.FInt= 10;
FStructField.FObj= this.FAggField;
}
private void InitArray()
{
FArrayProve[0]= new cAgregationClass();
((cAgregationClass)FArrayProve[0]).FStr= "Hello";
FArrayProve[1]= new cAgregationClass[2];
((cAgregationClass[])FArrayProve[1])[0]= this.FAggField;
FArrayProve[2]= new int[][][]{new int[][]{new int[3], new int[3], new int[3]}, new int[][]{new int[3], new int[3], new int[3]}};
/*Fill the integer array*/
((int[][][])FArrayProve[2])[1][1][1]= 10;
((int[][][])FArrayProve[2])[1][1][2]= 10;
((int[][][])FArrayProve[2])[1][1][0]= 10;
FArrayProve[3]= new OtherStruct();
FArrayProve[4]= 6;
FArrayProve[5]= true;
FArrayProve[6]= 2.5;
FArrayProve[7]= EnumSample.bb;
FArrayProve[8]= this.FInterfaceField;
FArrayProve[9]= "Hello";
FArrayProve[10]= new UInt32();
FArrayProve[11]= new short();
FArrayProve[12]= new UInt16();
FArrayProve[13]= new decimal();
FArrayProve[15]= new ulong();
FArrayProve[16]= new char();
FArrayProve[18]= null;
}
public void InitDelegates()
{
FDelegateProve= new DelegateProve(SIntProve);
FEventField= new OtherDelegate(OtherProve);
}
|