Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SchemaObjectWriter.cs
Go to the documentation of this file.
3using System.Text;
5
7
8internal sealed class SchemaObjectWriter
9{
10 private readonly StringBuilder _w = new StringBuilder();
11
12 private int _indentLevel = -1;
13
14 private void WriteIndent()
15 {
16 for (int i = 0; i < _indentLevel; i++)
17 {
18 _w.Append(' ');
19 }
20 }
21
22 private void WriteAttribute(string localName, string ns, string value)
23 {
24 if (value != null && value.Length != 0)
25 {
26 _w.Append(',');
27 _w.Append(ns);
28 if (ns != null && ns.Length != 0)
29 {
30 _w.Append(':');
31 }
32 _w.Append(localName);
33 _w.Append('=');
35 }
36 }
37
38 private void WriteAttribute(string localName, string ns, XmlQualifiedName value)
39 {
40 if (!value.IsEmpty)
41 {
42 WriteAttribute(localName, ns, value.ToString());
43 }
44 }
45
46 private void WriteStartElement(string name)
47 {
48 NewLine();
50 _w.Append('[');
51 _w.Append(name);
52 }
53
54 private void WriteEndElement()
55 {
56 _w.Append(']');
58 }
59
60 private void NewLine()
61 {
64 }
65
66 private string GetString()
67 {
68 return _w.ToString();
69 }
70
72 {
73 if (a.Value != null)
74 {
75 WriteAttribute(a.Name, a.NamespaceURI, a.Value);
76 }
77 }
78
80 {
81 if (a != null)
82 {
84 for (int i = 0; i < a.Length; i++)
85 {
86 arrayList.Add(a[i]);
87 }
89 for (int j = 0; j < arrayList.Count; j++)
90 {
93 }
94 }
95 }
96
97 [return: NotNullIfNotNull("list")]
98 internal static string ToString(NamespaceList list)
99 {
100 if (list == null)
101 {
102 return null;
103 }
104 switch (list.Type)
105 {
106 case NamespaceList.ListType.Any:
107 return "##any";
108 case NamespaceList.ListType.Other:
109 return "##other";
110 case NamespaceList.ListType.Set:
111 {
113 foreach (string item in list.Enumerate)
114 {
115 arrayList.Add(item);
116 }
117 arrayList.Sort();
119 bool flag = true;
120 foreach (string item2 in arrayList)
121 {
122 if (flag)
123 {
124 flag = false;
125 }
126 else
127 {
128 stringBuilder.Append(' ');
129 }
130 if (item2.Length == 0)
131 {
132 stringBuilder.Append("##local");
133 }
134 else
135 {
136 stringBuilder.Append(item2);
137 }
138 }
139 return stringBuilder.ToString();
140 }
141 default:
142 return list.ToString();
143 }
144 }
145
147 {
148 if (o == null)
149 {
150 return string.Empty;
151 }
153 return GetString();
154 }
155
157 {
158 if (items != null)
159 {
161 for (int i = 0; i < items.Count; i++)
162 {
163 arrayList.Add(items[i]);
164 }
166 for (int j = 0; j < arrayList.Count; j++)
167 {
169 }
170 }
171 }
172
174 {
175 if (o == null)
176 {
177 return;
178 }
179 WriteStartElement("attribute");
180 WriteAttribute("id", "", o.Id);
181 WriteAttributes(o.UnhandledAttributes, o);
182 WriteAttribute("default", "", o.DefaultValue);
183 WriteAttribute("fixed", "", o.FixedValue);
184 if (o.Parent != null && !(o.Parent is XmlSchema))
185 {
186 if (o.QualifiedName != null && !o.QualifiedName.IsEmpty && o.QualifiedName.Namespace != null && o.QualifiedName.Namespace.Length != 0)
187 {
188 WriteAttribute("form", "", "qualified");
189 }
190 else
191 {
192 WriteAttribute("form", "", "unqualified");
193 }
194 }
195 WriteAttribute("name", "", o.Name);
196 if (!o.RefName.IsEmpty)
197 {
198 WriteAttribute("ref", "", o.RefName);
199 }
200 else if (!o.SchemaTypeName.IsEmpty)
201 {
202 WriteAttribute("type", "", o.SchemaTypeName);
203 }
204 XmlSchemaUse v = ((o.Use == XmlSchemaUse.None) ? XmlSchemaUse.Optional : o.Use);
206 Write5_XmlSchemaAnnotation(o.Annotation);
207 Write9_XmlSchemaSimpleType(o.SchemaType);
209 }
210
212 {
213 if (o != null)
214 {
215 Type type = o.GetType();
217 {
219 }
220 else if (type == typeof(XmlSchemaSimpleType))
221 {
223 }
224 else if (type == typeof(XmlSchemaElement))
225 {
227 }
228 else if (type == typeof(XmlSchemaAppInfo))
229 {
231 }
233 {
235 }
236 else if (type == typeof(XmlSchemaAnnotation))
237 {
239 }
240 else if (type == typeof(XmlSchemaGroup))
241 {
243 }
244 else if (type == typeof(XmlSchemaXPath))
245 {
247 }
249 {
251 }
252 else if (type == typeof(XmlSchemaUnique))
253 {
255 }
256 else if (type == typeof(XmlSchemaKeyref))
257 {
259 }
260 else if (type == typeof(XmlSchemaKey))
261 {
263 }
264 else if (type == typeof(XmlSchemaGroupRef))
265 {
267 }
268 else if (type == typeof(XmlSchemaAny))
269 {
271 }
272 else if (type == typeof(XmlSchemaSequence))
273 {
275 }
276 else if (type == typeof(XmlSchemaChoice))
277 {
279 }
280 else if (type == typeof(XmlSchemaAll))
281 {
283 }
285 {
287 }
289 {
291 }
293 {
295 }
297 {
299 }
301 {
303 }
305 {
307 }
308 else if (type == typeof(XmlSchemaAnyAttribute))
309 {
311 }
313 {
315 }
317 {
319 }
321 {
323 }
325 {
327 }
329 {
331 }
332 else if (type == typeof(XmlSchemaAttribute))
333 {
335 }
336 }
337 }
338
340 {
341 if (o == null)
342 {
343 return;
344 }
345 WriteStartElement("annotation");
346 WriteAttribute("id", "", o.Id);
347 WriteAttributes(o.UnhandledAttributes, o);
348 XmlSchemaObjectCollection items = o.Items;
349 if (items != null)
350 {
351 for (int i = 0; i < items.Count; i++)
352 {
355 {
357 }
359 {
361 }
362 }
363 }
365 }
366
368 {
369 if (o == null)
370 {
371 return;
372 }
373 WriteStartElement("documentation");
374 WriteAttribute("source", "", o.Source);
375 WriteAttribute("lang", "http://www.w3.org/XML/1998/namespace", o.Language);
376 XmlNode[] markup = o.Markup;
377 if (markup != null)
378 {
379 foreach (XmlNode xmlNode in markup)
380 {
381 WriteStartElement("node");
382 WriteAttribute("xml", "", xmlNode.OuterXml);
383 }
384 }
386 }
387
389 {
390 if (o == null)
391 {
392 return;
393 }
394 WriteStartElement("appinfo");
395 WriteAttribute("source", "", o.Source);
396 XmlNode[] markup = o.Markup;
397 if (markup != null)
398 {
399 foreach (XmlNode xmlNode in markup)
400 {
401 WriteStartElement("node");
402 WriteAttribute("xml", "", xmlNode.OuterXml);
403 }
404 }
406 }
407
409 {
410 if (o != null)
411 {
412 WriteStartElement("simpleType");
413 WriteAttribute("id", "", o.Id);
414 WriteAttributes(o.UnhandledAttributes, o);
415 WriteAttribute("name", "", o.Name);
416 WriteAttribute("final", "", Write11_XmlSchemaDerivationMethod(o.FinalResolved));
417 Write5_XmlSchemaAnnotation(o.Annotation);
418 if (o.Content is XmlSchemaSimpleTypeUnion)
419 {
421 }
422 else if (o.Content is XmlSchemaSimpleTypeRestriction)
423 {
425 }
426 else if (o.Content is XmlSchemaSimpleTypeList)
427 {
429 }
431 }
432 }
433
435 {
436 return v.ToString();
437 }
438
440 {
441 if (o == null)
442 {
443 return;
444 }
445 WriteStartElement("union");
446 WriteAttribute("id", "", o.Id);
447 WriteAttributes(o.UnhandledAttributes, o);
448 if (o.MemberTypes != null)
449 {
451 for (int i = 0; i < o.MemberTypes.Length; i++)
452 {
453 arrayList.Add(o.MemberTypes[i]);
454 }
455 arrayList.Sort(new QNameComparer());
456 _w.Append(',');
457 _w.Append("memberTypes=");
458 for (int j = 0; j < arrayList.Count; j++)
459 {
461 _w.Append(xmlQualifiedName.ToString());
462 _w.Append(',');
463 }
464 }
465 Write5_XmlSchemaAnnotation(o.Annotation);
466 WriteSortedItems(o.BaseTypes);
468 }
469
471 {
472 if (o != null)
473 {
474 WriteStartElement("list");
475 WriteAttribute("id", "", o.Id);
476 WriteAttributes(o.UnhandledAttributes, o);
477 if (!o.ItemTypeName.IsEmpty)
478 {
479 WriteAttribute("itemType", "", o.ItemTypeName);
480 }
481 Write5_XmlSchemaAnnotation(o.Annotation);
484 }
485 }
486
488 {
489 if (o != null)
490 {
491 WriteStartElement("restriction");
492 WriteAttribute("id", "", o.Id);
493 WriteAttributes(o.UnhandledAttributes, o);
494 if (!o.BaseTypeName.IsEmpty)
495 {
496 WriteAttribute("base", "", o.BaseTypeName);
497 }
498 Write5_XmlSchemaAnnotation(o.Annotation);
500 WriteFacets(o.Facets);
502 }
503 }
504
506 {
507 if (facets == null)
508 {
509 return;
510 }
512 for (int i = 0; i < facets.Count; i++)
513 {
514 arrayList.Add(facets[i]);
515 }
516 arrayList.Sort(new XmlFacetComparer());
517 for (int j = 0; j < arrayList.Count; j++)
518 {
521 {
523 }
525 {
527 }
529 {
531 }
533 {
535 }
537 {
539 }
541 {
543 }
545 {
547 }
549 {
551 }
553 {
555 }
557 {
559 }
561 {
563 }
565 {
567 }
568 }
569 }
570
571 private void Write_XmlSchemaFacet(string name, XmlSchemaFacet o)
572 {
573 if (o != null)
574 {
575 WriteStartElement(name);
576 WriteAttribute("id", "", o.Id);
577 WriteAttribute("value", "", o.Value);
578 if (o.IsFixed)
579 {
580 WriteAttribute("fixed", "", XmlConvert.ToString(o.IsFixed));
581 }
582 WriteAttributes(o.UnhandledAttributes, o);
583 Write5_XmlSchemaAnnotation(o.Annotation);
585 }
586 }
587
589 {
590 string result = null;
591 switch (v)
592 {
593 case XmlSchemaUse.Optional:
594 result = "optional";
595 break;
596 case XmlSchemaUse.Prohibited:
597 result = "prohibited";
598 break;
599 case XmlSchemaUse.Required:
600 result = "required";
601 break;
602 }
603 return result;
604 }
605
607 {
608 if (o != null)
609 {
610 WriteStartElement("attributeGroup");
611 WriteAttribute("id", "", o.Id);
612 WriteAttribute("name", "", o.Name);
613 WriteAttributes(o.UnhandledAttributes, o);
614 Write5_XmlSchemaAnnotation(o.Annotation);
615 WriteSortedItems(o.Attributes);
616 Write33_XmlSchemaAnyAttribute(o.AnyAttribute);
618 }
619 }
620
622 {
623 if (o != null)
624 {
625 WriteStartElement("attributeGroup");
626 WriteAttribute("id", "", o.Id);
627 if (!o.RefName.IsEmpty)
628 {
629 WriteAttribute("ref", "", o.RefName);
630 }
631 WriteAttributes(o.UnhandledAttributes, o);
632 Write5_XmlSchemaAnnotation(o.Annotation);
634 }
635 }
636
638 {
639 if (o != null)
640 {
641 WriteStartElement("anyAttribute");
642 WriteAttribute("id", "", o.Id);
643 WriteAttribute("namespace", "", ToString(o.NamespaceList));
645 WriteAttribute("processContents", "", Write34_XmlSchemaContentProcessing(v));
646 WriteAttributes(o.UnhandledAttributes, o);
647 Write5_XmlSchemaAnnotation(o.Annotation);
649 }
650 }
651
653 {
654 string result = null;
655 switch (v)
656 {
658 result = "skip";
659 break;
661 result = "lax";
662 break;
663 case XmlSchemaContentProcessing.Strict:
664 result = "strict";
665 break;
666 }
667 return result;
668 }
669
671 {
672 if (o != null)
673 {
674 WriteStartElement("complexType");
675 WriteAttribute("id", "", o.Id);
676 WriteAttribute("name", "", o.Name);
677 WriteAttribute("final", "", Write11_XmlSchemaDerivationMethod(o.FinalResolved));
678 if (o.IsAbstract)
679 {
680 WriteAttribute("abstract", "", XmlConvert.ToString(o.IsAbstract));
681 }
682 WriteAttribute("block", "", Write11_XmlSchemaDerivationMethod(o.BlockResolved));
683 if (o.IsMixed)
684 {
685 WriteAttribute("mixed", "", XmlConvert.ToString(o.IsMixed));
686 }
687 WriteAttributes(o.UnhandledAttributes, o);
688 Write5_XmlSchemaAnnotation(o.Annotation);
689 if (o.ContentModel is XmlSchemaComplexContent)
690 {
692 }
693 else if (o.ContentModel is XmlSchemaSimpleContent)
694 {
696 }
697 if (o.Particle is XmlSchemaSequence)
698 {
700 }
701 else if (o.Particle is XmlSchemaGroupRef)
702 {
704 }
705 else if (o.Particle is XmlSchemaChoice)
706 {
708 }
709 else if (o.Particle is XmlSchemaAll)
710 {
712 }
713 WriteSortedItems(o.Attributes);
714 Write33_XmlSchemaAnyAttribute(o.AnyAttribute);
716 }
717 }
718
720 {
721 if (o != null)
722 {
723 WriteStartElement("simpleContent");
724 WriteAttribute("id", "", o.Id);
725 WriteAttributes(o.UnhandledAttributes, o);
726 Write5_XmlSchemaAnnotation(o.Annotation);
728 {
730 }
731 else if (o.Content is XmlSchemaSimpleContentExtension)
732 {
734 }
736 }
737 }
738
740 {
741 if (o != null)
742 {
743 WriteStartElement("extension");
744 WriteAttribute("id", "", o.Id);
745 WriteAttributes(o.UnhandledAttributes, o);
746 if (!o.BaseTypeName.IsEmpty)
747 {
748 WriteAttribute("base", "", o.BaseTypeName);
749 }
750 Write5_XmlSchemaAnnotation(o.Annotation);
751 WriteSortedItems(o.Attributes);
752 Write33_XmlSchemaAnyAttribute(o.AnyAttribute);
754 }
755 }
756
758 {
759 if (o != null)
760 {
761 WriteStartElement("restriction");
762 WriteAttribute("id", "", o.Id);
763 WriteAttributes(o.UnhandledAttributes, o);
764 if (!o.BaseTypeName.IsEmpty)
765 {
766 WriteAttribute("base", "", o.BaseTypeName);
767 }
768 Write5_XmlSchemaAnnotation(o.Annotation);
770 WriteFacets(o.Facets);
771 WriteSortedItems(o.Attributes);
772 Write33_XmlSchemaAnyAttribute(o.AnyAttribute);
774 }
775 }
776
778 {
779 if (o != null)
780 {
781 WriteStartElement("complexContent");
782 WriteAttribute("id", "", o.Id);
783 WriteAttribute("mixed", "", XmlConvert.ToString(o.IsMixed));
784 WriteAttributes(o.UnhandledAttributes, o);
785 Write5_XmlSchemaAnnotation(o.Annotation);
787 {
789 }
790 else if (o.Content is XmlSchemaComplexContentExtension)
791 {
793 }
795 }
796 }
797
799 {
800 if (o != null)
801 {
802 WriteStartElement("extension");
803 WriteAttribute("id", "", o.Id);
804 WriteAttributes(o.UnhandledAttributes, o);
805 if (!o.BaseTypeName.IsEmpty)
806 {
807 WriteAttribute("base", "", o.BaseTypeName);
808 }
809 Write5_XmlSchemaAnnotation(o.Annotation);
810 if (o.Particle is XmlSchemaSequence)
811 {
813 }
814 else if (o.Particle is XmlSchemaGroupRef)
815 {
817 }
818 else if (o.Particle is XmlSchemaChoice)
819 {
821 }
822 else if (o.Particle is XmlSchemaAll)
823 {
825 }
826 WriteSortedItems(o.Attributes);
827 Write33_XmlSchemaAnyAttribute(o.AnyAttribute);
829 }
830 }
831
833 {
834 if (o != null)
835 {
836 WriteStartElement("all");
837 WriteAttribute("id", "", o.Id);
838 WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
839 WriteAttribute("maxOccurs", "", (o.MaxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
840 WriteAttributes(o.UnhandledAttributes, o);
841 Write5_XmlSchemaAnnotation(o.Annotation);
842 WriteSortedItems(o.Items);
844 }
845 }
846
848 {
849 if (o == null)
850 {
851 return;
852 }
853 WriteStartElement("element");
854 WriteAttribute("id", "", o.Id);
855 WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
856 WriteAttribute("maxOccurs", "", (o.MaxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
857 if (o.IsAbstract)
858 {
859 WriteAttribute("abstract", "", XmlConvert.ToString(o.IsAbstract));
860 }
861 WriteAttribute("block", "", Write11_XmlSchemaDerivationMethod(o.BlockResolved));
862 WriteAttribute("default", "", o.DefaultValue);
863 WriteAttribute("final", "", Write11_XmlSchemaDerivationMethod(o.FinalResolved));
864 WriteAttribute("fixed", "", o.FixedValue);
865 if (o.Parent != null && !(o.Parent is XmlSchema))
866 {
867 if (o.QualifiedName != null && !o.QualifiedName.IsEmpty && o.QualifiedName.Namespace != null && o.QualifiedName.Namespace.Length != 0)
868 {
869 WriteAttribute("form", "", "qualified");
870 }
871 else
872 {
873 WriteAttribute("form", "", "unqualified");
874 }
875 }
876 if (o.Name != null && o.Name.Length != 0)
877 {
878 WriteAttribute("name", "", o.Name);
879 }
880 if (o.IsNillable)
881 {
882 WriteAttribute("nillable", "", XmlConvert.ToString(o.IsNillable));
883 }
884 if (!o.SubstitutionGroup.IsEmpty)
885 {
886 WriteAttribute("substitutionGroup", "", o.SubstitutionGroup);
887 }
888 if (!o.RefName.IsEmpty)
889 {
890 WriteAttribute("ref", "", o.RefName);
891 }
892 else if (!o.SchemaTypeName.IsEmpty)
893 {
894 WriteAttribute("type", "", o.SchemaTypeName);
895 }
896 WriteAttributes(o.UnhandledAttributes, o);
897 Write5_XmlSchemaAnnotation(o.Annotation);
898 if (o.SchemaType is XmlSchemaComplexType)
899 {
901 }
902 else if (o.SchemaType is XmlSchemaSimpleType)
903 {
905 }
906 WriteSortedItems(o.Constraints);
908 }
909
911 {
912 if (o == null)
913 {
914 return;
915 }
916 WriteStartElement("key");
917 WriteAttribute("id", "", o.Id);
918 WriteAttribute("name", "", o.Name);
919 WriteAttributes(o.UnhandledAttributes, o);
920 Write5_XmlSchemaAnnotation(o.Annotation);
921 Write49_XmlSchemaXPath("selector", "", o.Selector);
922 XmlSchemaObjectCollection fields = o.Fields;
923 if (fields != null)
924 {
925 for (int i = 0; i < fields.Count; i++)
926 {
927 Write49_XmlSchemaXPath("field", "", (XmlSchemaXPath)fields[i]);
928 }
929 }
931 }
932
934 {
935 if (o != null)
936 {
937 Type type = o.GetType();
939 {
941 }
942 else if (type == typeof(XmlSchemaKeyref))
943 {
945 }
946 else if (type == typeof(XmlSchemaKey))
947 {
949 }
950 }
951 }
952
953 private void Write49_XmlSchemaXPath(string name, string ns, XmlSchemaXPath o)
954 {
955 if (o != null)
956 {
957 WriteStartElement(name);
958 WriteAttribute("id", "", o.Id);
959 WriteAttribute("xpath", "", o.XPath);
960 WriteAttributes(o.UnhandledAttributes, o);
961 Write5_XmlSchemaAnnotation(o.Annotation);
963 }
964 }
965
967 {
968 if (o == null)
969 {
970 return;
971 }
972 WriteStartElement("keyref");
973 WriteAttribute("id", "", o.Id);
974 WriteAttribute("name", "", o.Name);
975 WriteAttributes(o.UnhandledAttributes, o);
976 WriteAttribute("refer", "", o.Refer);
977 Write5_XmlSchemaAnnotation(o.Annotation);
978 Write49_XmlSchemaXPath("selector", "", o.Selector);
979 XmlSchemaObjectCollection fields = o.Fields;
980 if (fields != null)
981 {
982 for (int i = 0; i < fields.Count; i++)
983 {
984 Write49_XmlSchemaXPath("field", "", (XmlSchemaXPath)fields[i]);
985 }
986 }
988 }
989
991 {
992 if (o == null)
993 {
994 return;
995 }
996 WriteStartElement("unique");
997 WriteAttribute("id", "", o.Id);
998 WriteAttribute("name", "", o.Name);
999 WriteAttributes(o.UnhandledAttributes, o);
1000 Write5_XmlSchemaAnnotation(o.Annotation);
1001 Write49_XmlSchemaXPath("selector", "", o.Selector);
1002 XmlSchemaObjectCollection fields = o.Fields;
1003 if (fields != null)
1004 {
1005 for (int i = 0; i < fields.Count; i++)
1006 {
1007 Write49_XmlSchemaXPath("field", "", (XmlSchemaXPath)fields[i]);
1008 }
1009 }
1011 }
1012
1014 {
1015 if (o != null)
1016 {
1017 WriteStartElement("choice");
1018 WriteAttribute("id", "", o.Id);
1019 WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
1020 WriteAttribute("maxOccurs", "", (o.MaxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
1021 WriteAttributes(o.UnhandledAttributes, o);
1022 Write5_XmlSchemaAnnotation(o.Annotation);
1023 WriteSortedItems(o.Items);
1025 }
1026 }
1027
1029 {
1030 if (o != null)
1031 {
1032 WriteStartElement("any");
1033 WriteAttribute("id", "", o.Id);
1034 WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
1035 WriteAttribute("maxOccurs", "", (o.MaxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
1036 WriteAttribute("namespace", "", ToString(o.NamespaceList));
1038 WriteAttribute("processContents", "", Write34_XmlSchemaContentProcessing(v));
1039 WriteAttributes(o.UnhandledAttributes, o);
1040 Write5_XmlSchemaAnnotation(o.Annotation);
1042 }
1043 }
1044
1046 {
1047 if (o == null)
1048 {
1049 return;
1050 }
1051 WriteStartElement("sequence");
1052 WriteAttribute("id", "", o.Id);
1053 WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
1054 WriteAttribute("maxOccurs", "", (o.MaxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
1055 WriteAttributes(o.UnhandledAttributes, o);
1056 Write5_XmlSchemaAnnotation(o.Annotation);
1057 XmlSchemaObjectCollection items = o.Items;
1058 if (items != null)
1059 {
1060 for (int i = 0; i < items.Count; i++)
1061 {
1064 {
1066 }
1068 {
1070 }
1072 {
1074 }
1076 {
1078 }
1080 {
1082 }
1083 }
1084 }
1086 }
1087
1089 {
1090 if (o != null)
1091 {
1092 WriteStartElement("group");
1093 WriteAttribute("id", "", o.Id);
1094 WriteAttribute("minOccurs", "", XmlConvert.ToString(o.MinOccurs));
1095 WriteAttribute("maxOccurs", "", (o.MaxOccurs == decimal.MaxValue) ? "unbounded" : XmlConvert.ToString(o.MaxOccurs));
1096 if (!o.RefName.IsEmpty)
1097 {
1098 WriteAttribute("ref", "", o.RefName);
1099 }
1100 WriteAttributes(o.UnhandledAttributes, o);
1101 Write5_XmlSchemaAnnotation(o.Annotation);
1103 }
1104 }
1105
1107 {
1108 if (o != null)
1109 {
1110 WriteStartElement("restriction");
1111 WriteAttribute("id", "", o.Id);
1112 WriteAttributes(o.UnhandledAttributes, o);
1113 if (!o.BaseTypeName.IsEmpty)
1114 {
1115 WriteAttribute("base", "", o.BaseTypeName);
1116 }
1117 Write5_XmlSchemaAnnotation(o.Annotation);
1118 if (o.Particle is XmlSchemaSequence)
1119 {
1121 }
1122 else if (o.Particle is XmlSchemaGroupRef)
1123 {
1125 }
1126 else if (o.Particle is XmlSchemaChoice)
1127 {
1129 }
1130 else if (o.Particle is XmlSchemaAll)
1131 {
1133 }
1134 WriteSortedItems(o.Attributes);
1135 Write33_XmlSchemaAnyAttribute(o.AnyAttribute);
1137 }
1138 }
1139
1141 {
1142 if (o != null)
1143 {
1144 WriteStartElement("group");
1145 WriteAttribute("id", "", o.Id);
1146 WriteAttribute("name", "", o.Name);
1147 WriteAttributes(o.UnhandledAttributes, o);
1148 Write5_XmlSchemaAnnotation(o.Annotation);
1149 if (o.Particle is XmlSchemaSequence)
1150 {
1152 }
1153 else if (o.Particle is XmlSchemaChoice)
1154 {
1156 }
1157 else if (o.Particle is XmlSchemaAll)
1158 {
1160 }
1162 }
1163 }
1164}
static string NewLine
override string ToString()
StringBuilder Append(char value, int repeatCount)
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
void Write35_XmlSchemaComplexType(XmlSchemaComplexType o)
void Write42_XmlSchemaComplexContentExtension(XmlSchemaComplexContentExtension o)
void WriteAttribute(string localName, string ns, string value)
void Write38_XmlSchemaSimpleContentExtension(XmlSchemaSimpleContentExtension o)
void Write1_XmlSchemaAttribute(XmlSchemaAttribute o)
void Write49_XmlSchemaXPath(string name, string ns, XmlSchemaXPath o)
void Write40_XmlSchemaSimpleContentRestriction(XmlSchemaSimpleContentRestriction o)
void WriteAttributes(XmlAttribute[] a, XmlSchemaObject o)
void Write14_XmlSchemaSimpleTypeList(XmlSchemaSimpleTypeList o)
string Write11_XmlSchemaDerivationMethod(XmlSchemaDerivationMethod v)
void Write15_XmlSchemaSimpleTypeRestriction(XmlSchemaSimpleTypeRestriction o)
void WriteFacets(XmlSchemaObjectCollection facets)
void Write31_XmlSchemaAttributeGroup(XmlSchemaAttributeGroup o)
void Write48_XmlSchemaIdentityConstraint(XmlSchemaIdentityConstraint o)
void Write56_XmlSchemaComplexContentRestriction(XmlSchemaComplexContentRestriction o)
void Write32_XmlSchemaAttributeGroupRef(XmlSchemaAttributeGroupRef o)
void WriteAttribute(string localName, string ns, XmlQualifiedName value)
void Write41_XmlSchemaComplexContent(XmlSchemaComplexContent o)
static string ToString(NamespaceList list)
void Write6_XmlSchemaDocumentation(XmlSchemaDocumentation o)
void Write9_XmlSchemaSimpleType(XmlSchemaSimpleType o)
void Write5_XmlSchemaAnnotation(XmlSchemaAnnotation o)
void Write36_XmlSchemaSimpleContent(XmlSchemaSimpleContent o)
void Write12_XmlSchemaSimpleTypeUnion(XmlSchemaSimpleTypeUnion o)
string Write34_XmlSchemaContentProcessing(XmlSchemaContentProcessing v)
void Write33_XmlSchemaAnyAttribute(XmlSchemaAnyAttribute o)
void Write_XmlSchemaFacet(string name, XmlSchemaFacet o)
void WriteSortedItems(XmlSchemaObjectCollection items)
static string ToString(bool value)