Welcome to mirror list, hosted at ThFree Co, Russian Federation.

XmlSerializerTestClasses.cs « System.Xml.Serialization « Test « System.XML « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 597acd1df54f69d3d2b8970b0e97d2f5df2e16c6 (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
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
//
// System.Xml.XmlSerializerTestClasses
//
// Authors:
//   Erik LeBel <eriklebel@yahoo.ca>
//   Hagit Yidov <hagity@mainsoft.com>
//
// (C) 2003 Erik LeBel
// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
//
// Classes to use in the testing of the XmlSerializer
//

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace MonoTests.System.Xml.TestClasses
{
	public enum SimpleEnumeration { FIRST, SECOND };

	[Flags]
	public enum EnumDefaultValue { e1 = 1, e2 = 2, e3 = 3 }
	public enum EnumDefaultValueNF { e1 = 1, e2 = 2, e3 = 3 }

	[Flags]
	public enum FlagEnum
	{
		[XmlEnum ("one")]
		e1 = 1,
		[XmlEnum ("two")]
		e2 = 2,
		[XmlEnum ("four")]
		e4 = 4
	}

	[Flags]
	[SoapType ("flagenum")]
	public enum FlagEnum_Encoded
	{
		[SoapEnum ("one")]
		e1 = 1,
		[SoapEnum ("two")]
		e2 = 2,
		[SoapEnum ("four")]
		e4 = 4
	}

	[Flags]
	public enum ZeroFlagEnum
	{
		[XmlEnum ("zero")]
		e0 = 0,
		[XmlEnum ("o<n>e")]
		e1 = 1,
		[XmlEnum ("tns:t<w>o")]
		e2 = 2,
		[XmlEnum ("four")]
		[XmlIgnore]
		e4 = 4
	}

	#region GenericsTestClasses

	public class GenSimpleClass<T>
	{
		public T something = default (T);
	}

	public struct GenSimpleStruct<T>
	{
		public T something;
		public GenSimpleStruct (int dummy)
		{
			something = default (T);
		}
	}

	public class GenListClass<T>
	{
		public List<T> somelist = new List<T> ();
	}

	public class GenArrayClass<T>
	{
		public T[] arr = new T[3];
	}

	public class GenTwoClass<T1, T2>
	{
		public T1 something1 = default (T1);
		public T2 something2 = default (T2);
	}

	public class GenDerivedClass<T1, T2> : GenTwoClass<string, int>
	{
		public T1 another1 = default (T1);
		public T2 another2 = default (T2);
	}

	public class GenDerived2Class<T1, T2> : GenTwoClass<T1, T2>
	{
		public T1 another1 = default (T1);
		public T2 another2 = default (T2);
	}

	public class GenNestedClass<TO, TI>
	{
		public TO outer = default (TO);
		public class InnerClass<T>
		{
			public TI inner = default (TI);
			public T something = default (T);
		}
	}

	public struct GenComplexStruct<T1, T2>
	{
		public T1 something;
		public GenSimpleClass<T1> simpleclass;
		public GenSimpleStruct<T1> simplestruct;
		public GenListClass<T1> listclass;
		public GenArrayClass<T1> arrayclass;
		public GenTwoClass<T1, T2> twoclass;
		public GenDerivedClass<T1, T2> derivedclass;
		public GenDerived2Class<T1, T2> derived2;
		public GenNestedClass<T1, T2> nestedouter;
		public GenNestedClass<T1, T2>.InnerClass<T1> nestedinner;
		public GenComplexStruct (int dummy)
		{
			something = default (T1);
			simpleclass = new GenSimpleClass<T1> ();
			simplestruct = new GenSimpleStruct<T1> ();
			listclass = new GenListClass<T1> ();
			arrayclass = new GenArrayClass<T1> ();
			twoclass = new GenTwoClass<T1, T2> ();
			derivedclass = new GenDerivedClass<T1, T2> ();
			derived2 = new GenDerived2Class<T1, T2> ();
			nestedouter = new GenNestedClass<T1, T2> ();
			nestedinner = new GenNestedClass<T1, T2>.InnerClass<T1> ();
		}
	}
		
	public class WithNulls
	{
		[XmlElement (IsNullable=true)]
		public int? nint;
		
		[XmlElement (IsNullable=true)]
		public TestEnumWithNulls? nenum;
		
		[XmlElement (IsNullable=true)]
		public DateTime? ndate;
	}
	
	public enum TestEnumWithNulls
	{
		aa,
		bb
	}
	

	#endregion // GenericsTestClasses

	public class SimpleClass
	{
		public string something = null;
	}

	public class StringCollection : CollectionBase
	{
		public void Add (String parameter)
		{
			List.Insert (Count, parameter);
		}

		public String this[int index]
		{
			get
			{
				if (index < 0 || index > Count)
					throw new ArgumentOutOfRangeException ();

				return (String) List[index];
			}
			set { List[index] = value; }
		}
	}

	public class StringCollectionContainer
	{
		StringCollection messages = new StringCollection ();

		public StringCollection Messages
		{
			get { return messages; }
		}
	}

	public class ArrayContainer
	{
		public object[] items = null;
	}

	public class ClassArrayContainer
	{
		public SimpleClass[] items = null;
	}

	[XmlRoot ("simple")]
	public class SimpleClassWithXmlAttributes
	{
		[XmlAttribute ("member")]
		public string something = null;
	}

	[XmlRoot ("field")]
	public class Field
	{
		[XmlAttribute ("flag1")]
		[DefaultValue (1)]
		public FlagEnum Flags1;

		[XmlAttribute ("flag2")]
		[DefaultValue (FlagEnum.e1)]
		public FlagEnum Flags2;

		[XmlAttribute ("flag3", Form = XmlSchemaForm.Qualified)]
		[DefaultValue (FlagEnum.e1 | FlagEnum.e2)]
		public FlagEnum Flags3;

		[XmlAttribute ("flag4")]
		public FlagEnum Flags4;

		[XmlAttribute ("modifiers")]
		public MapModifiers Modifiers;

		[XmlAttribute ("modifiers2", Form = XmlSchemaForm.Unqualified)]
		public MapModifiers Modifiers2;

		[XmlAttribute ("modifiers3")]
		[DefaultValue (0)]
		public MapModifiers Modifiers3;

		[XmlAttribute ("modifiers4", Form = XmlSchemaForm.Unqualified)]
		[DefaultValue (MapModifiers.Protected)]
		public MapModifiers Modifiers4;

		[XmlAttribute ("modifiers5", Form = XmlSchemaForm.Qualified)]
		[DefaultValue (MapModifiers.Public)]
		public MapModifiers Modifiers5;

		[XmlAttribute ("names")]
		public string[] Names;

		[XmlAttribute ("street")]
		public string Street;
	}

	[SoapType ("field", Namespace = "some:urn")]
	public class Field_Encoded
	{
		[SoapAttribute ("flag1")]
		[DefaultValue (FlagEnum_Encoded.e1)]
		public FlagEnum_Encoded Flags1;

		[SoapAttribute ("flag2")]
		[DefaultValue (FlagEnum_Encoded.e1)]
		public FlagEnum_Encoded Flags2;

		[SoapAttribute ("flag3")]
		[DefaultValue (FlagEnum_Encoded.e1 | FlagEnum_Encoded.e2)]
		public FlagEnum_Encoded Flags3;

		[SoapAttribute ("flag4")]
		public FlagEnum_Encoded Flags4;

		[SoapAttribute ("modifiers")]
		public MapModifiers Modifiers;

		[SoapAttribute ("modifiers2")]
		public MapModifiers Modifiers2;

		[SoapAttribute ("modifiers3")]
		[DefaultValue (MapModifiers.Public)]
		public MapModifiers Modifiers3;

		[SoapAttribute ("modifiers4")]
		[DefaultValue (MapModifiers.Protected)]
		public MapModifiers Modifiers4;

		[SoapAttribute ("modifiers5")]
		[DefaultValue (MapModifiers.Public)]
		public MapModifiers Modifiers5;

		public string[] Names;

		[SoapAttribute ("street")]
		public string Street;
	}

	[Flags]
	public enum MapModifiers
	{
		[XmlEnum ("public")]
		[SoapEnum ("PuBlIc")]
		Public = 0,
		[XmlEnum ("protected")]
		Protected = 1,
	}

	public class MyList : ArrayList
	{
		object container;

		// NOTE: MyList has no public constructor
		public MyList (object container)
			: base ()
		{
			this.container = container;
		}
	}

	public class Container
	{
		public MyList Items;

		public Container ()
		{
			Items = new MyList (this);
		}
	}

	public class Container2
	{
		public MyList Items;

		public Container2 ()
		{
		}

		public Container2 (bool b)
		{
			Items = new MyList (this);
		}
	}

	public class MyElem : XmlElement
	{
		public MyElem (XmlDocument doc)
			: base ("", "myelem", "", doc)
		{
			SetAttribute ("aa", "1");
		}

		[XmlAttribute]
		public int kk = 1;
	}

	public class MyDocument : XmlDocument
	{
		public MyDocument ()
		{
		}

		[XmlAttribute]
		public int kk = 1;
	}

	public class CDataContainer
	{
		public XmlCDataSection cdata;
	}

	public class NodeContainer
	{
		public XmlNode node;
	}

	public class Choices
	{
		[XmlElementAttribute ("ChoiceZero", typeof (string), IsNullable = false)]
		[XmlElementAttribute ("ChoiceOne", typeof (string), IsNullable = false)]
		[XmlElementAttribute ("ChoiceTwo", typeof (string), IsNullable = false)]
		[XmlChoiceIdentifier ("ItemType")]
		public string MyChoice;

		[XmlIgnore]
		public ItemChoiceType ItemType;
	}

	[XmlType (IncludeInSchema = false)]
	public enum ItemChoiceType
	{
		ChoiceZero,
		[XmlEnum ("ChoiceOne")]
		StrangeOne,
		ChoiceTwo,
	}

	public class WrongChoices
	{
		[XmlElementAttribute ("ChoiceZero", typeof (string), IsNullable = false)]
		[XmlElementAttribute ("StrangeOne", typeof (string), IsNullable = false)]
		[XmlElementAttribute ("ChoiceTwo", typeof (string), IsNullable = false)]
		[XmlChoiceIdentifier ("ItemType")]
		public string MyChoice;

		[XmlIgnore]
		public ItemChoiceType ItemType;
	}

	[XmlType ("Type with space")]
	public class TestSpace
	{
		[XmlElement (ElementName = "Element with space")]
		public int elem;

		[XmlAttribute (AttributeName = "Attribute with space")]
		public int attr;
	}

	[Serializable]
	public class ReadOnlyProperties
	{
		string[] strArr = new string[2] { "string1", "string2" };
		List<string> strList = new List<string> { "listString1" };

		public string[] StrArr
		{
			get { return strArr; }
		}

		public string dat
		{
			get { return "fff"; }
		}

		public IList<string> StrList { get { return strList; } }
	}

	[Serializable]
	public class ReadOnlyListProperty {
		List<string> strList = new List<string> { "listString1", "listString2" };

		public List<string> StrList
		{
			get { return strList; }
		}
	}


	[XmlRoot ("root")]
	public class ListDefaults
	{
		public ListDefaults ()
		{
			ed = new SimpleClass ();
			str = "hola";
		}

		public ArrayList list2;

//		public MyList list3;

		public string[] list4;

		[XmlElement ("e", typeof (SimpleClass))]
		public ArrayList list5;

		[DefaultValue (null)]
		public SimpleClass ed;

		[DefaultValue (null)]
		public string str;
	}

	public class clsPerson
	{
		public IList EmailAccounts;
	}

	public class ArrayClass
	{
		public object names = new object[] { "un", "dos" };
	}

	public class CompositeValueType
	{
		public void Init ()
		{
			Items = new object[] { 1, 2 };
			ItemsElementName = new ItemsChoiceType[] { ItemsChoiceType.In, ItemsChoiceType.Es };
		}

		[XmlElementAttribute ("Es", typeof (int))]
		[XmlElementAttribute ("In", typeof (int))]
		[XmlChoiceIdentifierAttribute ("ItemsElementName")]
		public object[] Items;

		[XmlElementAttribute ("ItemsElementName")]
		[XmlIgnoreAttribute ()]
		public ItemsChoiceType[] ItemsElementName;
	}

	public enum ItemsChoiceType
	{
		In, Es
	}

	public class ArrayAttributeWithType
	{
		[XmlAttribute (DataType = "anyURI")]
		public string[] at = new string[] { "a", "b" };

		[XmlAttribute (DataType = "base64Binary")]
		public byte[][] bin1 = new byte[][] { new byte[] { 1, 2 }, new byte[] { 1, 2 } };

		[XmlAttribute (DataType = "base64Binary")]
		public byte[] bin2 = new byte[] { 1, 2 };
	}

	public class ArrayAttributeWithWrongType
	{
		[XmlAttribute (DataType = "int")]
		public string[] at = new string[] { "a", "b" };
	}

	[XmlType ("Container")]
	public class EntityContainer
	{
		EntityCollection collection1;
		EntityCollection collection2;
		EntityCollection collection3 = new EntityCollection ("root");
		EntityCollection collection4 = new EntityCollection ("root");

		[XmlArray (IsNullable = true)]
		public EntityCollection Collection1
		{
			get { return collection1; }
			set { collection1 = value; collection1.Container = "assigned"; }
		}

		[XmlArray (IsNullable = false)]
		public EntityCollection Collection2
		{
			get { return collection2; }
			set { collection2 = value; collection2.Container = "assigned"; }
		}

		[XmlArray (IsNullable = true)]
		public EntityCollection Collection3
		{
			get { return collection3; }
			set { collection3 = value; collection3.Container = "assigned"; }
		}

		[XmlArray (IsNullable = false)]
		public EntityCollection Collection4
		{
			get { return collection4; }
			set { collection4 = value; collection4.Container = "assigned"; }
		}
	}

	[XmlType ("Container")]
	public class ArrayEntityContainer
	{
		Entity[] collection1;
		Entity[] collection2;
		Entity[] collection3 = new Entity[0];
		Entity[] collection4 = new Entity[0];

		[XmlArray (IsNullable = true)]
		public Entity[] Collection1
		{
			get { return collection1; }
			set { collection1 = value; }
		}

		[XmlArray (IsNullable = false)]
		public Entity[] Collection2
		{
			get { return collection2; }
			set { collection2 = value; }
		}

		[XmlArray (IsNullable = true)]
		public Entity[] Collection3
		{
			get { return collection3; }
			set { collection3 = value; }
		}

		[XmlArray (IsNullable = false)]
		public Entity[] Collection4
		{
			get { return collection4; }
			set { collection4 = value; }
		}
	}

	public class Entity
	{
		private string _name = string.Empty;
		private string _parent = null;

		[XmlAttribute]
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		[XmlIgnore]
		public string Parent
		{
			get { return _parent; }
			set { _parent = value; }
		}
	}

	public class EntityCollection : ArrayList
	{
		public string _container;

		public EntityCollection ()
		{
		}

		public EntityCollection (string c)
		{
			_container = c;
		}

		public string Container
		{
			get { return _container; }
			set { _container = value; }
		}

		public int Add (Entity value)
		{
			if (_container != null)
				value.Parent = _container;

			return base.Add (value);
		}

		public new Entity this[int index]
		{
			get { return (Entity) base[index]; }
			set { base[index] = value; }
		}
	}

	[XmlType ("Container")]
	public class ObjectWithReadonlyCollection
	{
		EntityCollection collection1 = new EntityCollection ("root");

		public EntityCollection Collection1
		{
			get { return collection1; }
		}
	}

	[XmlType ("Container")]
	public class ObjectWithReadonlyNulCollection
	{
		EntityCollection collection1;

		public EntityCollection Collection1
		{
			get { return collection1; }
		}
	}

	[XmlType ("Container")]
	public class ObjectWithReadonlyArray
	{
		Entity[] collection1 = new Entity[0];

		public Entity[] Collection1
		{
			get { return collection1; }
		}
	}

	[XmlInclude (typeof (SubclassTestSub))]
	public class SubclassTestBase
	{
	}

	public class SubclassTestSub : SubclassTestBase
	{
	}

	public class SubclassTestExtra
	{
	}

	public class SubclassTestContainer
	{
		[XmlElement ("a", typeof (SubclassTestBase))]
		[XmlElement ("b", typeof (SubclassTestExtra))]
		public object data;
	}

	public class DictionaryWithIndexer : DictionaryBase
	{
		public TimeSpan this[int index]
		{
			get { return TimeSpan.MinValue; }
		}

		public void Add (TimeSpan value)
		{
		}
	}

	[XmlRoot (Namespace = "some:urn")]
	[SoapTypeAttribute (Namespace = "another:urn")]
	public class PrimitiveTypesContainer
	{
		public PrimitiveTypesContainer ()
		{
			Number = 2004;
			Name = "some name";
			Index = (byte) 56;
			Password = new byte[] { 243, 15 };
			PathSeparatorCharacter = '/';
		}

		public int Number;
		public string Name;
		public byte Index;
		public byte[] Password;
		public char PathSeparatorCharacter;
	}

	public class TestSchemaForm1
	{
		public PrintTypeResponse p1;

		[XmlElement (Namespace = "urn:oo")]
		public PrintTypeResponse p2;
	}

	[XmlType (Namespace = "urn:testForm")]
	public class TestSchemaForm2
	{
		public PrintTypeResponse p1;

		[XmlElement (Namespace = "urn:oo")]
		public PrintTypeResponse p2;
	}

	[XmlType (Namespace = "urn:responseTypes")]
	public class PrintTypeResponse
	{
		[XmlElement (Form = XmlSchemaForm.Unqualified, IsNullable = true)]
		public OutputType result;
		public PrintTypeResponse intern;

		public void Init ()
		{
			result = new OutputType ();
			result.data = "data1";
			intern = new PrintTypeResponse ();
			intern.result = new OutputType ();
			intern.result.data = "data2";
		}
	}

	[XmlType (Namespace = "urn:responseTypes")]
	public class OutputType
	{

		[XmlElement (Form = XmlSchemaForm.Unqualified, IsNullable = true)]
		public string data;
	}

	[XmlRootAttribute ("testDefault", Namespace = "urn:myNS", IsNullable = false)]
	[SoapType ("testDefault", Namespace = "urn:myNS")]
	public class TestDefault
	{
		public string str;

		[DefaultValue ("Default Value")]
		public string strDefault = "Default Value";

		[DefaultValue (true)]
		public bool boolT = true;

		[DefaultValue (false)]
		public bool boolF = false;

		[DefaultValue (typeof (decimal), "10")]
		public decimal decimalval = 10m;

		[DefaultValue (FlagEnum.e1 | FlagEnum.e4)]
		public FlagEnum flag = (FlagEnum.e1 | FlagEnum.e4);

		[DefaultValue (FlagEnum_Encoded.e1 | FlagEnum_Encoded.e4)]
		public FlagEnum_Encoded flagencoded = (FlagEnum_Encoded.e1 | FlagEnum_Encoded.e4);
	}

	[XmlType ("optionalValueType", Namespace = "some:urn")]
	[XmlRootAttribute ("optionalValue", Namespace = "another:urn", IsNullable = false)]
	public class OptionalValueTypeContainer
	{
		[DefaultValue (FlagEnum.e1 | FlagEnum.e4)]
		public FlagEnum Attributes = FlagEnum.e1 | FlagEnum.e4;

		[DefaultValue (FlagEnum.e1)]
		public FlagEnum Flags = FlagEnum.e1;

		[XmlIgnore]
		[SoapIgnore]
		public bool FlagsSpecified;

		[DefaultValue (false)]
		public bool IsEmpty;

		[XmlIgnore]
		[SoapIgnore]
		public bool IsEmptySpecified
		{
			get { return _isEmptySpecified; }
			set { _isEmptySpecified = value; }
		}

		[DefaultValue (false)]
		public bool IsNull;

		private bool _isEmptySpecified;
	}

	public class Group
	{
		[SoapAttribute (Namespace = "http://www.cpandl.com")]
		public string GroupName;

		[SoapAttribute (DataType = "base64Binary")]
		public Byte[] GroupNumber;

		[SoapAttribute (DataType = "date", AttributeName = "CreationDate")]
		public DateTime Today;

		[SoapElement (DataType = "nonNegativeInteger", ElementName = "PosInt")]
		public string PostitiveInt;

		[SoapIgnore]
		public bool IgnoreThis;

		[DefaultValue (GroupType.B)]
		public GroupType Grouptype;
		public Vehicle MyVehicle;

		[SoapInclude (typeof (Car))]
		public Vehicle myCar (string licNumber)
		{
			Vehicle v;
			if (licNumber == string.Empty) {
				v = new Car ();
				v.licenseNumber = "!!!!!!";
			}
			else {
				v = new Car ();
				v.licenseNumber = licNumber;
			}
			return v;
		}
	}

	[SoapInclude (typeof (Car))]
	public abstract class Vehicle
	{
		public string licenseNumber;
		[SoapElement (DataType = "date")]
		public DateTime makeDate;
		[DefaultValue ("450")]
		public string weight;
	}

	public class Car : Vehicle
	{
	}

	public enum GroupType
	{
		[SoapEnum ("Small")]
		A,
		[SoapEnum ("Large")]
		B
	}

	public class ErrorneousGetSchema : IXmlSerializable
	{
		public XmlSchema GetSchema ()
		{
			throw new ApplicationException ("unexpected");
		}

		public void ReadXml (XmlReader reader)
		{
		}

		public void WriteXml (XmlWriter writer)
		{
		}

		// it should be serialized IF it is NOT IXmlSerializable.
		public string Whoa = "whoa";
	}

	[XmlRoot ("DefaultDateTimeContainer", Namespace = "urn:foo")]
	public class DefaultDateTimeContainer // bug #378696
	{
		public DateTime SimpleDateTime;

		[DefaultValue(typeof(DateTime), "2001-02-03T04:05:06")]
		public DateTime FancyDateTime;

		[DefaultValue (typeof (int), "123456")]
		public int Numeric;
	}

	public class XmlSerializableImplicitConvertible
	{
		public BaseClass B = new DerivedClass ();

		public class XmlSerializable : IXmlSerializable
		{
			public void WriteXml (XmlWriter writer)
			{
			}

			public void ReadXml (XmlReader reader)
			{
			}

			public XmlSchema GetSchema ()
			{
				return null;
			}
		}

		public class BaseClass
		{
			public static implicit operator XmlSerializable (BaseClass b)
			{
				return new XmlSerializable ();

			}

			public static implicit operator BaseClass (XmlSerializable x)
			{
				return new BaseClass ();
			}
		}

		public class DerivedClass : BaseClass
		{
		}
	}

	public class Bug704813Type
	{
		IEnumerable<string> foo = new List<string> ();
		public IEnumerable<string> Foo {
			get { return foo; }
		}
	}

	public class Bug708178Type
	{
		List<string> foo = new List<string> ();

		[XmlArray("Foo"), XmlArrayItem("Foo", typeof(string))]
		public List<string> Foo {
			get { return foo; }
		}                
	}

	[XmlRoot("root")]
	public class ExplicitlyOrderedMembersType1
	{
		[XmlElement("child0", Order = 4)]
		public string Child0;

		[XmlElement("child", Order = 0)]
		public string Child1;

		[XmlElement("child", Order = 2)]
		public string Child2;
	}

	[XmlRoot("root")]
	public class ExplicitlyOrderedMembersType2
	{
		[XmlElement("child0", Order = 4)]
		public string Child0;

		[XmlElement("child")] // wrong. Needs to be Ordered as well.
		public string Child1;

		[XmlElement("child", Order = 2)]
		public string Child2;
	}

	[XmlRoot("root")]
	public class ExplicitlyOrderedMembersType3
	{
		[XmlElement("child0", Order = 1)] // it's between 0 and 2. After two "child" elements, child0 is not recognized as this member.
		public string Child0;

		[XmlElement("child", Order = 0)]
		public string Child1;

		[XmlElement("child", Order = 2)]
		public string Child2;
	}

	[XmlRoot("root")]
	public class ExplicitlyOrderedMembersType4
	{
		[XmlElement("child0", Order = 1)] // it's between 0 and 2. After two "child" elements, child0 is not recognized as this member.
		public string Child0;
		
		[XmlElement("child", Order = 0)]
		public string Child1;
		
		[XmlElement("child", Order = 2)]
		public string Child2;
		
		[XmlAttribute]
		public string Child3;
	}

	[XmlRoot ("root")]
	public class NullableDatesAndTimes {
		[XmlElementAttribute ("MyTime", DataType = "time", IsNullable = false)]
		public DateTime MyTime;
			
		[XmlElementAttribute ("MyTimeNullable", DataType = "time", IsNullable = true)]
		public DateTime? MyTimeNullable;
		
		[XmlElementAttribute ("MyDate", DataType = "date", IsNullable = false)]
		public DateTime MyDate;
		
		[XmlElementAttribute ("MyDateNullable", DataType = "date", IsNullable = true)]
		public DateTime? MyDateNullable;
	}

	public class NotExactDateParseClass
	{
		[XmlElementAttribute (DataType = "date")]
		public DateTime SomeDate;
	}

	public class Bug8468BaseClass
	{
		public string Base;
	}

	public class Bug8468MidClass: Bug8468BaseClass
	{
		public string Mid;
	}

	[XmlRoot("Test", Namespace="http://test-namespace")]
	public class Bug8468Subclass: Bug8468MidClass
	{
	}

	[XmlRoot("Test")]
	public class Bug8468SubclassNoNamespace: Bug8468MidClass
	{
	}

	[XmlRoot("Test", Namespace="")]
	public class Bug8468BaseClassV2
	{
		public string Base;
	}

	public class Bug8468MidClassV2: Bug8468BaseClassV2
	{
		public string Mid;
	}

	[XmlRoot("Test", Namespace="http://test-namespace")]
	public class Bug8468SubclassV2: Bug8468MidClassV2
	{
	}

	[XmlRoot("Test")]
	public class Bug8468SubclassNoNamespaceV2: Bug8468MidClassV2
	{
	}
	
	[XmlRoot("Test")]
	public class Bug9193Class
	{
		[XmlElement ("Data", Order=0)]
		public string[] Data;
		[XmlElement ("Extra", Order=1)]
		public string[] Extra;
	}

	public class SimpleObjectA
	{
		[XmlAttribute]
		public string Text
		{
			get; set;
		}

		public static implicit operator SimpleObjectA (SimpleObjectB o)
		{
			return new SimpleObjectA { Text = o.Text };
		}

		public static implicit operator SimpleObjectB (SimpleObjectA o)
		{
		 return new SimpleObjectB { Text = o.Text };
		}
	}

	public class SimpleObjectB
	{
		[XmlAttribute]
		public string Text
		{
			get; set;
		}
	}

	public class ObjectWithElementRequiringImplicitCast
	{
		public ObjectWithElementRequiringImplicitCast () { }
		public ObjectWithElementRequiringImplicitCast (string text)
		{
			Object = new SimpleObjectB { Text = text };
		}

		[XmlElement(Type = typeof (SimpleObjectA))]
		public SimpleObjectB Object
		{
			get; set;
		}
	}

	public class ObjectWithNullableArrayItems
	{
		[XmlArrayItem ("Element", IsNullable = true)]
		public List<SimpleClass> Elements;
	}

	public class ObjectWithNonNullableArrayItems
	{
		[XmlArrayItem ("Element", IsNullable = false)]
		public List<SimpleClass> Elements;
	}

	public class ObjectWithNotSpecifiedNullableArrayItems
	{
		[XmlArrayItem ("Element")]
		public List<SimpleClass> Elements;
	}

	[Serializable]
	public sealed class ClassWithDefaultTextNotNull
	{
		[XmlText]
		public string Value;

		public const string DefaultValue = "NotNull";

		public ClassWithDefaultTextNotNull (string v) {
			Value = v;
		}

		public ClassWithDefaultTextNotNull () {
			Value = DefaultValue;
		}
    }
}