CustomSerializer.cs 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065
  1. //
  2. // CustomSerializer.cs
  3. //
  4. // This code is autogenerated from SerializationCodeGenerator (and removed
  5. // GeneratedReader, and renamed class name and namespace name.)
  6. //
  7. // Author:
  8. // Atsushi Enomoto <[email protected]>
  9. //
  10. // (C)2004 Novell Inc.
  11. //
  12. using System;
  13. using System.Xml;
  14. using System.Xml.Schema;
  15. using System.Xml.Serialization;
  16. using System.Text;
  17. using System.Collections;
  18. using System.Globalization;
  19. namespace System.Xml.Schema
  20. {
  21. internal class XmlSchemaSerializationWriter : XmlSerializationWriter
  22. {
  23. public void WriteRoot_XmlSchema (object o)
  24. {
  25. WriteStartDocument ();
  26. System.Xml.Schema.XmlSchema ob = (System.Xml.Schema.XmlSchema) o;
  27. TopLevelElement ();
  28. WriteObject_XmlSchema (ob, "schema", "http://www.w3.org/2001/XMLSchema", true, false, true);
  29. }
  30. void WriteObject_XmlSchema (System.Xml.Schema.XmlSchema ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  31. {
  32. if (ob == null)
  33. {
  34. if (isNullable)
  35. WriteNullTagLiteral(element, namesp);
  36. return;
  37. }
  38. if (writeWrappingElem) {
  39. WriteStartElement (element, namesp, ob);
  40. }
  41. if (needType) WriteXsiType("XmlSchema", "http://www.w3.org/2001/XMLSchema");
  42. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  43. WriteAttribute ("id", "", ob.@Id);
  44. if (ob.@ElementFormDefault != ((System.Xml.Schema.XmlSchemaForm) 0)) {
  45. WriteAttribute ("elementFormDefault", "", GetEnumValue_XmlSchemaForm (ob.@ElementFormDefault));
  46. }
  47. if (ob.@BlockDefault != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  48. WriteAttribute ("blockDefault", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@BlockDefault));
  49. }
  50. WriteAttribute ("version", "", ob.@Version);
  51. if (ob.@FinalDefault != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  52. WriteAttribute ("finalDefault", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@FinalDefault));
  53. }
  54. if (ob.@AttributeFormDefault != ((System.Xml.Schema.XmlSchemaForm) 0)) {
  55. WriteAttribute ("attributeFormDefault", "", GetEnumValue_XmlSchemaForm (ob.@AttributeFormDefault));
  56. }
  57. WriteAttribute ("targetNamespace", "", ob.@TargetNamespace);
  58. ICollection o133 = ob.@UnhandledAttributes;
  59. if (o133 != null) {
  60. foreach (XmlAttribute o134 in o133)
  61. WriteXmlAttribute (o134, ob);
  62. }
  63. if (ob.@Includes != null) {
  64. for (int n135 = 0; n135 < [email protected]; n135++) {
  65. if (ob.@Includes[n135] == null) { }
  66. else if (ob.@Includes[n135].GetType() == typeof(System.Xml.Schema.XmlSchemaInclude)) {
  67. WriteObject_XmlSchemaInclude (((System.Xml.Schema.XmlSchemaInclude) ob.@Includes[n135]), "include", "http://www.w3.org/2001/XMLSchema", false, false, true);
  68. }
  69. else if (ob.@Includes[n135].GetType() == typeof(System.Xml.Schema.XmlSchemaImport)) {
  70. WriteObject_XmlSchemaImport (((System.Xml.Schema.XmlSchemaImport) ob.@Includes[n135]), "import", "http://www.w3.org/2001/XMLSchema", false, false, true);
  71. }
  72. else if (ob.@Includes[n135].GetType() == typeof(System.Xml.Schema.XmlSchemaRedefine)) {
  73. WriteObject_XmlSchemaRedefine (((System.Xml.Schema.XmlSchemaRedefine) ob.@Includes[n135]), "redefine", "http://www.w3.org/2001/XMLSchema", false, false, true);
  74. }
  75. else throw CreateUnknownTypeException (ob.@Includes[n135]);
  76. }
  77. }
  78. if (ob.@Items != null) {
  79. for (int n136 = 0; n136 < [email protected]; n136++) {
  80. if (ob.@Items[n136] == null) { }
  81. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  82. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Items[n136]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  83. }
  84. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaNotation)) {
  85. WriteObject_XmlSchemaNotation (((System.Xml.Schema.XmlSchemaNotation) ob.@Items[n136]), "notation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  86. }
  87. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  88. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n136]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  89. }
  90. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroup)) {
  91. WriteObject_XmlSchemaAttributeGroup (((System.Xml.Schema.XmlSchemaAttributeGroup) ob.@Items[n136]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  92. }
  93. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaGroup)) {
  94. WriteObject_XmlSchemaGroup (((System.Xml.Schema.XmlSchemaGroup) ob.@Items[n136]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  95. }
  96. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaAnnotation)) {
  97. WriteObject_XmlSchemaAnnotation (((System.Xml.Schema.XmlSchemaAnnotation) ob.@Items[n136]), "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  98. }
  99. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaComplexType)) {
  100. WriteObject_XmlSchemaComplexType (((System.Xml.Schema.XmlSchemaComplexType) ob.@Items[n136]), "complexType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  101. }
  102. else if (ob.@Items[n136].GetType() == typeof(System.Xml.Schema.XmlSchemaSimpleType)) {
  103. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@Items[n136]), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  104. }
  105. else throw CreateUnknownTypeException (ob.@Items[n136]);
  106. }
  107. }
  108. if (writeWrappingElem) WriteEndElement (ob);
  109. }
  110. void WriteObject_XmlSchemaForm (System.Xml.Schema.XmlSchemaForm ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  111. {
  112. if (writeWrappingElem) {
  113. WriteStartElement (element, namesp, ob);
  114. }
  115. if (needType) WriteXsiType("XmlSchemaForm", "");
  116. Writer.WriteString (GetEnumValue_XmlSchemaForm (ob));
  117. if (writeWrappingElem) WriteEndElement (ob);
  118. }
  119. string GetEnumValue_XmlSchemaForm (System.Xml.Schema.XmlSchemaForm val)
  120. {
  121. switch (val)
  122. {
  123. case System.Xml.Schema.XmlSchemaForm.Qualified: return "qualified";
  124. case System.Xml.Schema.XmlSchemaForm.Unqualified: return "unqualified";
  125. default: return ((long)val).ToString();
  126. }
  127. }
  128. void WriteObject_XmlSchemaDerivationMethod (System.Xml.Schema.XmlSchemaDerivationMethod ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  129. {
  130. if (writeWrappingElem) {
  131. WriteStartElement (element, namesp, ob);
  132. }
  133. if (needType) WriteXsiType("XmlSchemaDerivationMethod", "");
  134. Writer.WriteString (GetEnumValue_XmlSchemaDerivationMethod (ob));
  135. if (writeWrappingElem) WriteEndElement (ob);
  136. }
  137. string GetEnumValue_XmlSchemaDerivationMethod (System.Xml.Schema.XmlSchemaDerivationMethod val)
  138. {
  139. switch (val)
  140. {
  141. case System.Xml.Schema.XmlSchemaDerivationMethod.Empty: return "";
  142. case System.Xml.Schema.XmlSchemaDerivationMethod.Substitution: return "substitution";
  143. case System.Xml.Schema.XmlSchemaDerivationMethod.Extension: return "extension";
  144. case System.Xml.Schema.XmlSchemaDerivationMethod.Restriction: return "restriction";
  145. case System.Xml.Schema.XmlSchemaDerivationMethod.List: return "list";
  146. case System.Xml.Schema.XmlSchemaDerivationMethod.Union: return "union";
  147. case System.Xml.Schema.XmlSchemaDerivationMethod.All: return "#all";
  148. default:
  149. System.Text.StringBuilder sb = new System.Text.StringBuilder ();
  150. string[] enumNames = val.ToString().Split (',');
  151. foreach (string name in enumNames)
  152. {
  153. switch (name.Trim())
  154. {
  155. case "Empty": sb.Append ("").Append (' '); break;
  156. case "Substitution": sb.Append ("substitution").Append (' '); break;
  157. case "Extension": sb.Append ("extension").Append (' '); break;
  158. case "Restriction": sb.Append ("restriction").Append (' '); break;
  159. case "List": sb.Append ("list").Append (' '); break;
  160. case "Union": sb.Append ("union").Append (' '); break;
  161. case "All": sb.Append ("#all").Append (' '); break;
  162. default: sb.Append (name.Trim()).Append (' '); break;
  163. }
  164. }
  165. return sb.ToString ().Trim();
  166. }
  167. }
  168. void WriteObject_XmlSchemaInclude (System.Xml.Schema.XmlSchemaInclude ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  169. {
  170. if (ob == null)
  171. {
  172. if (isNullable)
  173. WriteNullTagLiteral(element, namesp);
  174. return;
  175. }
  176. if (writeWrappingElem) {
  177. WriteStartElement (element, namesp, ob);
  178. }
  179. if (needType) WriteXsiType("XmlSchemaInclude", "http://www.w3.org/2001/XMLSchema");
  180. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  181. WriteAttribute ("schemaLocation", "", ob.@SchemaLocation);
  182. WriteAttribute ("id", "", ob.@Id);
  183. ICollection o137 = ob.@UnhandledAttributes;
  184. if (o137 != null) {
  185. foreach (XmlAttribute o138 in o137)
  186. WriteXmlAttribute (o138, ob);
  187. }
  188. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  189. if (writeWrappingElem) WriteEndElement (ob);
  190. }
  191. void WriteObject_XmlSchemaImport (System.Xml.Schema.XmlSchemaImport ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  192. {
  193. if (ob == null)
  194. {
  195. if (isNullable)
  196. WriteNullTagLiteral(element, namesp);
  197. return;
  198. }
  199. if (writeWrappingElem) {
  200. WriteStartElement (element, namesp, ob);
  201. }
  202. if (needType) WriteXsiType("XmlSchemaImport", "http://www.w3.org/2001/XMLSchema");
  203. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  204. WriteAttribute ("schemaLocation", "", ob.@SchemaLocation);
  205. WriteAttribute ("namespace", "", ob.@Namespace);
  206. WriteAttribute ("id", "", ob.@Id);
  207. ICollection o139 = ob.@UnhandledAttributes;
  208. if (o139 != null) {
  209. foreach (XmlAttribute o140 in o139)
  210. WriteXmlAttribute (o140, ob);
  211. }
  212. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  213. if (writeWrappingElem) WriteEndElement (ob);
  214. }
  215. void WriteObject_XmlSchemaRedefine (System.Xml.Schema.XmlSchemaRedefine ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  216. {
  217. if (ob == null)
  218. {
  219. if (isNullable)
  220. WriteNullTagLiteral(element, namesp);
  221. return;
  222. }
  223. if (writeWrappingElem) {
  224. WriteStartElement (element, namesp, ob);
  225. }
  226. if (needType) WriteXsiType("XmlSchemaRedefine", "http://www.w3.org/2001/XMLSchema");
  227. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  228. WriteAttribute ("schemaLocation", "", ob.@SchemaLocation);
  229. WriteAttribute ("id", "", ob.@Id);
  230. ICollection o141 = ob.@UnhandledAttributes;
  231. if (o141 != null) {
  232. foreach (XmlAttribute o142 in o141)
  233. WriteXmlAttribute (o142, ob);
  234. }
  235. if (ob.@Items != null) {
  236. for (int n143 = 0; n143 < [email protected]; n143++) {
  237. if (ob.@Items[n143] == null) { }
  238. else if (ob.@Items[n143].GetType() == typeof(System.Xml.Schema.XmlSchemaGroup)) {
  239. WriteObject_XmlSchemaGroup (((System.Xml.Schema.XmlSchemaGroup) ob.@Items[n143]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  240. }
  241. else if (ob.@Items[n143].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroup)) {
  242. WriteObject_XmlSchemaAttributeGroup (((System.Xml.Schema.XmlSchemaAttributeGroup) ob.@Items[n143]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  243. }
  244. else if (ob.@Items[n143].GetType() == typeof(System.Xml.Schema.XmlSchemaAnnotation)) {
  245. WriteObject_XmlSchemaAnnotation (((System.Xml.Schema.XmlSchemaAnnotation) ob.@Items[n143]), "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  246. }
  247. else if (ob.@Items[n143].GetType() == typeof(System.Xml.Schema.XmlSchemaSimpleType)) {
  248. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@Items[n143]), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  249. }
  250. else if (ob.@Items[n143].GetType() == typeof(System.Xml.Schema.XmlSchemaComplexType)) {
  251. WriteObject_XmlSchemaComplexType (((System.Xml.Schema.XmlSchemaComplexType) ob.@Items[n143]), "complexType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  252. }
  253. else throw CreateUnknownTypeException (ob.@Items[n143]);
  254. }
  255. }
  256. if (writeWrappingElem) WriteEndElement (ob);
  257. }
  258. void WriteObject_XmlSchemaAttribute (System.Xml.Schema.XmlSchemaAttribute ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  259. {
  260. if (ob == null)
  261. {
  262. if (isNullable)
  263. WriteNullTagLiteral(element, namesp);
  264. return;
  265. }
  266. if (writeWrappingElem) {
  267. WriteStartElement (element, namesp, ob);
  268. }
  269. if (needType) WriteXsiType("XmlSchemaAttribute", "http://www.w3.org/2001/XMLSchema");
  270. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  271. WriteAttribute ("id", "", ob.@Id);
  272. if (ob.@Use != ((System.Xml.Schema.XmlSchemaUse) 0)) {
  273. WriteAttribute ("use", "", GetEnumValue_XmlSchemaUse (ob.@Use));
  274. }
  275. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  276. if (ob.@Form != ((System.Xml.Schema.XmlSchemaForm) 0)) {
  277. WriteAttribute ("form", "", GetEnumValue_XmlSchemaForm (ob.@Form));
  278. }
  279. WriteAttribute ("type", "", FromXmlQualifiedName (ob.@SchemaTypeName));
  280. if (ob.@FixedValue != null) {
  281. WriteAttribute ("fixed", "", ob.@FixedValue);
  282. }
  283. if (ob.@DefaultValue != null) {
  284. WriteAttribute ("default", "", ob.@DefaultValue);
  285. }
  286. WriteAttribute ("name", "", ob.@Name);
  287. ICollection o144 = ob.@UnhandledAttributes;
  288. if (o144 != null) {
  289. foreach (XmlAttribute o145 in o144)
  290. WriteXmlAttribute (o145, ob);
  291. }
  292. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  293. WriteObject_XmlSchemaSimpleType (ob.@SchemaType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  294. if (writeWrappingElem) WriteEndElement (ob);
  295. }
  296. void WriteObject_XmlSchemaNotation (System.Xml.Schema.XmlSchemaNotation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  297. {
  298. if (ob == null)
  299. {
  300. if (isNullable)
  301. WriteNullTagLiteral(element, namesp);
  302. return;
  303. }
  304. if (writeWrappingElem) {
  305. WriteStartElement (element, namesp, ob);
  306. }
  307. if (needType) WriteXsiType("XmlSchemaNotation", "http://www.w3.org/2001/XMLSchema");
  308. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  309. WriteAttribute ("id", "", ob.@Id);
  310. WriteAttribute ("public", "", ob.@Public);
  311. WriteAttribute ("name", "", ob.@Name);
  312. WriteAttribute ("system", "", ob.@System);
  313. ICollection o146 = ob.@UnhandledAttributes;
  314. if (o146 != null) {
  315. foreach (XmlAttribute o147 in o146)
  316. WriteXmlAttribute (o147, ob);
  317. }
  318. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  319. if (writeWrappingElem) WriteEndElement (ob);
  320. }
  321. void WriteObject_XmlSchemaElement (System.Xml.Schema.XmlSchemaElement ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  322. {
  323. if (ob == null)
  324. {
  325. if (isNullable)
  326. WriteNullTagLiteral(element, namesp);
  327. return;
  328. }
  329. if (writeWrappingElem) {
  330. WriteStartElement (element, namesp, ob);
  331. }
  332. if (needType) WriteXsiType("XmlSchemaElement", "http://www.w3.org/2001/XMLSchema");
  333. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  334. if (ob.@Form != ((System.Xml.Schema.XmlSchemaForm) 0)) {
  335. WriteAttribute ("form", "", GetEnumValue_XmlSchemaForm (ob.@Form));
  336. }
  337. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  338. if (ob.@Final != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  339. WriteAttribute ("final", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Final));
  340. }
  341. WriteAttribute ("substitutionGroup", "", FromXmlQualifiedName (ob.@SubstitutionGroup));
  342. if (ob.@IsNillable != false) {
  343. WriteAttribute ("nillable", "", (ob.@IsNillable?"true":"false"));
  344. }
  345. if (ob.@IsAbstract != false) {
  346. WriteAttribute ("abstract", "", (ob.@IsAbstract?"true":"false"));
  347. }
  348. if (ob.@FixedValue != null) {
  349. WriteAttribute ("fixed", "", ob.@FixedValue);
  350. }
  351. WriteAttribute ("id", "", ob.@Id);
  352. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  353. if (ob.@DefaultValue != null) {
  354. WriteAttribute ("default", "", ob.@DefaultValue);
  355. }
  356. if (ob.@Name != null) {
  357. WriteAttribute ("name", "", ob.@Name);
  358. }
  359. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  360. if (ob.@Block != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  361. WriteAttribute ("block", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Block));
  362. }
  363. WriteAttribute ("type", "", FromXmlQualifiedName (ob.@SchemaTypeName));
  364. ICollection o148 = ob.@UnhandledAttributes;
  365. if (o148 != null) {
  366. foreach (XmlAttribute o149 in o148)
  367. WriteXmlAttribute (o149, ob);
  368. }
  369. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  370. if (ob.@SchemaType is System.Xml.Schema.XmlSchemaSimpleType) {
  371. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@SchemaType), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  372. }
  373. else if (ob.@SchemaType is System.Xml.Schema.XmlSchemaComplexType) {
  374. WriteObject_XmlSchemaComplexType (((System.Xml.Schema.XmlSchemaComplexType) ob.@SchemaType), "complexType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  375. }
  376. if (ob.@Constraints != null) {
  377. for (int n150 = 0; n150 < [email protected]; n150++) {
  378. if (ob.@Constraints[n150] == null) { }
  379. else if (ob.@Constraints[n150].GetType() == typeof(System.Xml.Schema.XmlSchemaKeyref)) {
  380. WriteObject_XmlSchemaKeyref (((System.Xml.Schema.XmlSchemaKeyref) ob.@Constraints[n150]), "keyref", "http://www.w3.org/2001/XMLSchema", false, false, true);
  381. }
  382. else if (ob.@Constraints[n150].GetType() == typeof(System.Xml.Schema.XmlSchemaUnique)) {
  383. WriteObject_XmlSchemaUnique (((System.Xml.Schema.XmlSchemaUnique) ob.@Constraints[n150]), "unique", "http://www.w3.org/2001/XMLSchema", false, false, true);
  384. }
  385. else if (ob.@Constraints[n150].GetType() == typeof(System.Xml.Schema.XmlSchemaKey)) {
  386. WriteObject_XmlSchemaKey (((System.Xml.Schema.XmlSchemaKey) ob.@Constraints[n150]), "key", "http://www.w3.org/2001/XMLSchema", false, false, true);
  387. }
  388. else throw CreateUnknownTypeException (ob.@Constraints[n150]);
  389. }
  390. }
  391. if (writeWrappingElem) WriteEndElement (ob);
  392. }
  393. void WriteObject_XmlSchemaAttributeGroup (System.Xml.Schema.XmlSchemaAttributeGroup ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  394. {
  395. if (ob == null)
  396. {
  397. if (isNullable)
  398. WriteNullTagLiteral(element, namesp);
  399. return;
  400. }
  401. if (writeWrappingElem) {
  402. WriteStartElement (element, namesp, ob);
  403. }
  404. if (needType) WriteXsiType("XmlSchemaAttributeGroup", "http://www.w3.org/2001/XMLSchema");
  405. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  406. WriteAttribute ("id", "", ob.@Id);
  407. WriteAttribute ("name", "", ob.@Name);
  408. ICollection o151 = ob.@UnhandledAttributes;
  409. if (o151 != null) {
  410. foreach (XmlAttribute o152 in o151)
  411. WriteXmlAttribute (o152, ob);
  412. }
  413. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  414. if (ob.@Attributes != null) {
  415. for (int n153 = 0; n153 < [email protected]; n153++) {
  416. if (ob.@Attributes[n153] == null) { }
  417. else if (ob.@Attributes[n153].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  418. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n153]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  419. }
  420. else if (ob.@Attributes[n153].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  421. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n153]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  422. }
  423. else throw CreateUnknownTypeException (ob.@Attributes[n153]);
  424. }
  425. }
  426. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  427. if (writeWrappingElem) WriteEndElement (ob);
  428. }
  429. void WriteObject_XmlSchemaGroup (System.Xml.Schema.XmlSchemaGroup ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  430. {
  431. if (ob == null)
  432. {
  433. if (isNullable)
  434. WriteNullTagLiteral(element, namesp);
  435. return;
  436. }
  437. if (writeWrappingElem) {
  438. WriteStartElement (element, namesp, ob);
  439. }
  440. if (needType) WriteXsiType("XmlSchemaGroup", "http://www.w3.org/2001/XMLSchema");
  441. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  442. WriteAttribute ("id", "", ob.@Id);
  443. WriteAttribute ("name", "", ob.@Name);
  444. ICollection o154 = ob.@UnhandledAttributes;
  445. if (o154 != null) {
  446. foreach (XmlAttribute o155 in o154)
  447. WriteXmlAttribute (o155, ob);
  448. }
  449. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  450. if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  451. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  452. }
  453. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  454. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  455. }
  456. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  457. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  458. }
  459. if (writeWrappingElem) WriteEndElement (ob);
  460. }
  461. void WriteObject_XmlSchemaAnnotation (System.Xml.Schema.XmlSchemaAnnotation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  462. {
  463. if (ob == null)
  464. {
  465. if (isNullable)
  466. WriteNullTagLiteral(element, namesp);
  467. return;
  468. }
  469. if (writeWrappingElem) {
  470. WriteStartElement (element, namesp, ob);
  471. }
  472. if (needType) WriteXsiType("XmlSchemaAnnotation", "http://www.w3.org/2001/XMLSchema");
  473. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  474. WriteAttribute ("id", "", ob.@Id);
  475. ICollection o156 = ob.@UnhandledAttributes;
  476. if (o156 != null) {
  477. foreach (XmlAttribute o157 in o156)
  478. WriteXmlAttribute (o157, ob);
  479. }
  480. if (ob.@Items != null) {
  481. for (int n158 = 0; n158 < [email protected]; n158++) {
  482. if (ob.@Items[n158] == null) { }
  483. else if (ob.@Items[n158].GetType() == typeof(System.Xml.Schema.XmlSchemaAppInfo)) {
  484. WriteObject_XmlSchemaAppInfo (((System.Xml.Schema.XmlSchemaAppInfo) ob.@Items[n158]), "appinfo", "http://www.w3.org/2001/XMLSchema", false, false, true);
  485. }
  486. else if (ob.@Items[n158].GetType() == typeof(System.Xml.Schema.XmlSchemaDocumentation)) {
  487. WriteObject_XmlSchemaDocumentation (((System.Xml.Schema.XmlSchemaDocumentation) ob.@Items[n158]), "documentation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  488. }
  489. else throw CreateUnknownTypeException (ob.@Items[n158]);
  490. }
  491. }
  492. if (writeWrappingElem) WriteEndElement (ob);
  493. }
  494. void WriteObject_XmlSchemaComplexType (System.Xml.Schema.XmlSchemaComplexType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  495. {
  496. if (ob == null)
  497. {
  498. if (isNullable)
  499. WriteNullTagLiteral(element, namesp);
  500. return;
  501. }
  502. if (writeWrappingElem) {
  503. WriteStartElement (element, namesp, ob);
  504. }
  505. if (needType) WriteXsiType("XmlSchemaComplexType", "http://www.w3.org/2001/XMLSchema");
  506. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  507. WriteAttribute ("id", "", ob.@Id);
  508. if (ob.@IsAbstract != false) {
  509. WriteAttribute ("abstract", "", (ob.@IsAbstract?"true":"false"));
  510. }
  511. WriteAttribute ("name", "", ob.@Name);
  512. if (ob.@IsMixed != false) {
  513. WriteAttribute ("mixed", "", (ob.@IsMixed?"true":"false"));
  514. }
  515. if (ob.@Block != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  516. WriteAttribute ("block", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Block));
  517. }
  518. if (ob.@Final != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  519. WriteAttribute ("final", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Final));
  520. }
  521. ICollection o159 = ob.@UnhandledAttributes;
  522. if (o159 != null) {
  523. foreach (XmlAttribute o160 in o159)
  524. WriteXmlAttribute (o160, ob);
  525. }
  526. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  527. if (ob.@ContentModel is System.Xml.Schema.XmlSchemaSimpleContent) {
  528. WriteObject_XmlSchemaSimpleContent (((System.Xml.Schema.XmlSchemaSimpleContent) ob.@ContentModel), "simpleContent", "http://www.w3.org/2001/XMLSchema", false, false, true);
  529. }
  530. else if (ob.@ContentModel is System.Xml.Schema.XmlSchemaComplexContent) {
  531. WriteObject_XmlSchemaComplexContent (((System.Xml.Schema.XmlSchemaComplexContent) ob.@ContentModel), "complexContent", "http://www.w3.org/2001/XMLSchema", false, false, true);
  532. }
  533. if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  534. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  535. }
  536. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  537. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  538. }
  539. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  540. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  541. }
  542. else if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  543. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  544. }
  545. if (ob.@Attributes != null) {
  546. for (int n161 = 0; n161 < [email protected]; n161++) {
  547. if (ob.@Attributes[n161] == null) { }
  548. else if (ob.@Attributes[n161].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  549. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n161]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  550. }
  551. else if (ob.@Attributes[n161].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  552. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n161]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  553. }
  554. else throw CreateUnknownTypeException (ob.@Attributes[n161]);
  555. }
  556. }
  557. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  558. if (writeWrappingElem) WriteEndElement (ob);
  559. }
  560. void WriteObject_XmlSchemaSimpleType (System.Xml.Schema.XmlSchemaSimpleType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  561. {
  562. if (ob == null)
  563. {
  564. if (isNullable)
  565. WriteNullTagLiteral(element, namesp);
  566. return;
  567. }
  568. if (writeWrappingElem) {
  569. WriteStartElement (element, namesp, ob);
  570. }
  571. if (needType) WriteXsiType("XmlSchemaSimpleType", "http://www.w3.org/2001/XMLSchema");
  572. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  573. WriteAttribute ("id", "", ob.@Id);
  574. WriteAttribute ("name", "", ob.@Name);
  575. if (ob.@Final != ((System.Xml.Schema.XmlSchemaDerivationMethod) 256)) {
  576. WriteAttribute ("final", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Final));
  577. }
  578. ICollection o162 = ob.@UnhandledAttributes;
  579. if (o162 != null) {
  580. foreach (XmlAttribute o163 in o162)
  581. WriteXmlAttribute (o163, ob);
  582. }
  583. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  584. if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleTypeUnion) {
  585. WriteObject_XmlSchemaSimpleTypeUnion (((System.Xml.Schema.XmlSchemaSimpleTypeUnion) ob.@Content), "union", "http://www.w3.org/2001/XMLSchema", false, false, true);
  586. }
  587. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleTypeList) {
  588. WriteObject_XmlSchemaSimpleTypeList (((System.Xml.Schema.XmlSchemaSimpleTypeList) ob.@Content), "list", "http://www.w3.org/2001/XMLSchema", false, false, true);
  589. }
  590. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleTypeRestriction) {
  591. WriteObject_XmlSchemaSimpleTypeRestriction (((System.Xml.Schema.XmlSchemaSimpleTypeRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  592. }
  593. if (writeWrappingElem) WriteEndElement (ob);
  594. }
  595. void WriteObject_XmlSchemaUse (System.Xml.Schema.XmlSchemaUse ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  596. {
  597. if (writeWrappingElem) {
  598. WriteStartElement (element, namesp, ob);
  599. }
  600. if (needType) WriteXsiType("XmlSchemaUse", "");
  601. Writer.WriteString (GetEnumValue_XmlSchemaUse (ob));
  602. if (writeWrappingElem) WriteEndElement (ob);
  603. }
  604. string GetEnumValue_XmlSchemaUse (System.Xml.Schema.XmlSchemaUse val)
  605. {
  606. switch (val)
  607. {
  608. case System.Xml.Schema.XmlSchemaUse.Optional: return "optional";
  609. case System.Xml.Schema.XmlSchemaUse.Prohibited: return "prohibited";
  610. case System.Xml.Schema.XmlSchemaUse.Required: return "required";
  611. default: return ((long)val).ToString();
  612. }
  613. }
  614. void WriteObject_XmlSchemaKeyref (System.Xml.Schema.XmlSchemaKeyref ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  615. {
  616. if (ob == null)
  617. {
  618. if (isNullable)
  619. WriteNullTagLiteral(element, namesp);
  620. return;
  621. }
  622. if (writeWrappingElem) {
  623. WriteStartElement (element, namesp, ob);
  624. }
  625. if (needType) WriteXsiType("XmlSchemaKeyref", "http://www.w3.org/2001/XMLSchema");
  626. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  627. WriteAttribute ("id", "", ob.@Id);
  628. WriteAttribute ("refer", "", FromXmlQualifiedName (ob.@Refer));
  629. WriteAttribute ("name", "", ob.@Name);
  630. ICollection o164 = ob.@UnhandledAttributes;
  631. if (o164 != null) {
  632. foreach (XmlAttribute o165 in o164)
  633. WriteXmlAttribute (o165, ob);
  634. }
  635. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  636. WriteObject_XmlSchemaXPath (ob.@Selector, "selector", "http://www.w3.org/2001/XMLSchema", false, false, true);
  637. if (ob.@Fields != null) {
  638. for (int n166 = 0; n166 < [email protected]; n166++) {
  639. WriteObject_XmlSchemaXPath (((System.Xml.Schema.XmlSchemaXPath) ob.@Fields[n166]), "field", "http://www.w3.org/2001/XMLSchema", false, false, true);
  640. }
  641. }
  642. if (writeWrappingElem) WriteEndElement (ob);
  643. }
  644. void WriteObject_XmlSchemaUnique (System.Xml.Schema.XmlSchemaUnique ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  645. {
  646. if (ob == null)
  647. {
  648. if (isNullable)
  649. WriteNullTagLiteral(element, namesp);
  650. return;
  651. }
  652. if (writeWrappingElem) {
  653. WriteStartElement (element, namesp, ob);
  654. }
  655. if (needType) WriteXsiType("XmlSchemaUnique", "http://www.w3.org/2001/XMLSchema");
  656. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  657. WriteAttribute ("id", "", ob.@Id);
  658. WriteAttribute ("name", "", ob.@Name);
  659. ICollection o167 = ob.@UnhandledAttributes;
  660. if (o167 != null) {
  661. foreach (XmlAttribute o168 in o167)
  662. WriteXmlAttribute (o168, ob);
  663. }
  664. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  665. WriteObject_XmlSchemaXPath (ob.@Selector, "selector", "http://www.w3.org/2001/XMLSchema", false, false, true);
  666. if (ob.@Fields != null) {
  667. for (int n169 = 0; n169 < [email protected]; n169++) {
  668. WriteObject_XmlSchemaXPath (((System.Xml.Schema.XmlSchemaXPath) ob.@Fields[n169]), "field", "http://www.w3.org/2001/XMLSchema", false, false, true);
  669. }
  670. }
  671. if (writeWrappingElem) WriteEndElement (ob);
  672. }
  673. void WriteObject_XmlSchemaKey (System.Xml.Schema.XmlSchemaKey ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  674. {
  675. if (ob == null)
  676. {
  677. if (isNullable)
  678. WriteNullTagLiteral(element, namesp);
  679. return;
  680. }
  681. if (writeWrappingElem) {
  682. WriteStartElement (element, namesp, ob);
  683. }
  684. if (needType) WriteXsiType("XmlSchemaKey", "http://www.w3.org/2001/XMLSchema");
  685. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  686. WriteAttribute ("id", "", ob.@Id);
  687. WriteAttribute ("name", "", ob.@Name);
  688. ICollection o170 = ob.@UnhandledAttributes;
  689. if (o170 != null) {
  690. foreach (XmlAttribute o171 in o170)
  691. WriteXmlAttribute (o171, ob);
  692. }
  693. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  694. WriteObject_XmlSchemaXPath (ob.@Selector, "selector", "http://www.w3.org/2001/XMLSchema", false, false, true);
  695. if (ob.@Fields != null) {
  696. for (int n172 = 0; n172 < [email protected]; n172++) {
  697. WriteObject_XmlSchemaXPath (((System.Xml.Schema.XmlSchemaXPath) ob.@Fields[n172]), "field", "http://www.w3.org/2001/XMLSchema", false, false, true);
  698. }
  699. }
  700. if (writeWrappingElem) WriteEndElement (ob);
  701. }
  702. void WriteObject_XmlSchemaAttributeGroupRef (System.Xml.Schema.XmlSchemaAttributeGroupRef ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  703. {
  704. if (ob == null)
  705. {
  706. if (isNullable)
  707. WriteNullTagLiteral(element, namesp);
  708. return;
  709. }
  710. if (writeWrappingElem) {
  711. WriteStartElement (element, namesp, ob);
  712. }
  713. if (needType) WriteXsiType("XmlSchemaAttributeGroupRef", "http://www.w3.org/2001/XMLSchema");
  714. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  715. WriteAttribute ("id", "", ob.@Id);
  716. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  717. ICollection o173 = ob.@UnhandledAttributes;
  718. if (o173 != null) {
  719. foreach (XmlAttribute o174 in o173)
  720. WriteXmlAttribute (o174, ob);
  721. }
  722. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  723. if (writeWrappingElem) WriteEndElement (ob);
  724. }
  725. void WriteObject_XmlSchemaAnyAttribute (System.Xml.Schema.XmlSchemaAnyAttribute ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  726. {
  727. if (ob == null)
  728. {
  729. if (isNullable)
  730. WriteNullTagLiteral(element, namesp);
  731. return;
  732. }
  733. if (writeWrappingElem) {
  734. WriteStartElement (element, namesp, ob);
  735. }
  736. if (needType) WriteXsiType("XmlSchemaAnyAttribute", "http://www.w3.org/2001/XMLSchema");
  737. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  738. WriteAttribute ("id", "", ob.@Id);
  739. if (ob.@ProcessContents != ((System.Xml.Schema.XmlSchemaContentProcessing) 0)) {
  740. WriteAttribute ("processContents", "", GetEnumValue_XmlSchemaContentProcessing (ob.@ProcessContents));
  741. }
  742. WriteAttribute ("namespace", "", ob.@Namespace);
  743. ICollection o175 = ob.@UnhandledAttributes;
  744. if (o175 != null) {
  745. foreach (XmlAttribute o176 in o175)
  746. WriteXmlAttribute (o176, ob);
  747. }
  748. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  749. if (writeWrappingElem) WriteEndElement (ob);
  750. }
  751. void WriteObject_XmlSchemaChoice (System.Xml.Schema.XmlSchemaChoice ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  752. {
  753. if (ob == null)
  754. {
  755. if (isNullable)
  756. WriteNullTagLiteral(element, namesp);
  757. return;
  758. }
  759. if (writeWrappingElem) {
  760. WriteStartElement (element, namesp, ob);
  761. }
  762. if (needType) WriteXsiType("XmlSchemaChoice", "http://www.w3.org/2001/XMLSchema");
  763. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  764. WriteAttribute ("id", "", ob.@Id);
  765. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  766. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  767. ICollection o177 = ob.@UnhandledAttributes;
  768. if (o177 != null) {
  769. foreach (XmlAttribute o178 in o177)
  770. WriteXmlAttribute (o178, ob);
  771. }
  772. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  773. if (ob.@Items != null) {
  774. for (int n179 = 0; n179 < [email protected]; n179++) {
  775. if (ob.@Items[n179] == null) { }
  776. else if (ob.@Items[n179].GetType() == typeof(System.Xml.Schema.XmlSchemaChoice)) {
  777. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Items[n179]), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  778. }
  779. else if (ob.@Items[n179].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  780. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n179]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  781. }
  782. else if (ob.@Items[n179].GetType() == typeof(System.Xml.Schema.XmlSchemaAny)) {
  783. WriteObject_XmlSchemaAny (((System.Xml.Schema.XmlSchemaAny) ob.@Items[n179]), "any", "http://www.w3.org/2001/XMLSchema", false, false, true);
  784. }
  785. else if (ob.@Items[n179].GetType() == typeof(System.Xml.Schema.XmlSchemaGroupRef)) {
  786. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Items[n179]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  787. }
  788. else if (ob.@Items[n179].GetType() == typeof(System.Xml.Schema.XmlSchemaSequence)) {
  789. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Items[n179]), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  790. }
  791. else throw CreateUnknownTypeException (ob.@Items[n179]);
  792. }
  793. }
  794. if (writeWrappingElem) WriteEndElement (ob);
  795. }
  796. void WriteObject_XmlSchemaSequence (System.Xml.Schema.XmlSchemaSequence ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  797. {
  798. if (ob == null)
  799. {
  800. if (isNullable)
  801. WriteNullTagLiteral(element, namesp);
  802. return;
  803. }
  804. if (writeWrappingElem) {
  805. WriteStartElement (element, namesp, ob);
  806. }
  807. if (needType) WriteXsiType("XmlSchemaSequence", "http://www.w3.org/2001/XMLSchema");
  808. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  809. WriteAttribute ("id", "", ob.@Id);
  810. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  811. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  812. ICollection o180 = ob.@UnhandledAttributes;
  813. if (o180 != null) {
  814. foreach (XmlAttribute o181 in o180)
  815. WriteXmlAttribute (o181, ob);
  816. }
  817. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  818. if (ob.@Items != null) {
  819. for (int n182 = 0; n182 < [email protected]; n182++) {
  820. if (ob.@Items[n182] == null) { }
  821. else if (ob.@Items[n182].GetType() == typeof(System.Xml.Schema.XmlSchemaAny)) {
  822. WriteObject_XmlSchemaAny (((System.Xml.Schema.XmlSchemaAny) ob.@Items[n182]), "any", "http://www.w3.org/2001/XMLSchema", false, false, true);
  823. }
  824. else if (ob.@Items[n182].GetType() == typeof(System.Xml.Schema.XmlSchemaSequence)) {
  825. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Items[n182]), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  826. }
  827. else if (ob.@Items[n182].GetType() == typeof(System.Xml.Schema.XmlSchemaChoice)) {
  828. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Items[n182]), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  829. }
  830. else if (ob.@Items[n182].GetType() == typeof(System.Xml.Schema.XmlSchemaGroupRef)) {
  831. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Items[n182]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  832. }
  833. else if (ob.@Items[n182].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  834. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n182]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  835. }
  836. else throw CreateUnknownTypeException (ob.@Items[n182]);
  837. }
  838. }
  839. if (writeWrappingElem) WriteEndElement (ob);
  840. }
  841. void WriteObject_XmlSchemaAll (System.Xml.Schema.XmlSchemaAll ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  842. {
  843. if (ob == null)
  844. {
  845. if (isNullable)
  846. WriteNullTagLiteral(element, namesp);
  847. return;
  848. }
  849. if (writeWrappingElem) {
  850. WriteStartElement (element, namesp, ob);
  851. }
  852. if (needType) WriteXsiType("XmlSchemaAll", "http://www.w3.org/2001/XMLSchema");
  853. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  854. WriteAttribute ("id", "", ob.@Id);
  855. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  856. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  857. ICollection o183 = ob.@UnhandledAttributes;
  858. if (o183 != null) {
  859. foreach (XmlAttribute o184 in o183)
  860. WriteXmlAttribute (o184, ob);
  861. }
  862. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  863. if (ob.@Items != null) {
  864. for (int n185 = 0; n185 < [email protected]; n185++) {
  865. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n185]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  866. }
  867. }
  868. if (writeWrappingElem) WriteEndElement (ob);
  869. }
  870. void WriteObject_XmlSchemaAppInfo (System.Xml.Schema.XmlSchemaAppInfo ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  871. {
  872. if (ob == null)
  873. {
  874. if (isNullable)
  875. WriteNullTagLiteral(element, namesp);
  876. return;
  877. }
  878. if (writeWrappingElem) {
  879. WriteStartElement (element, namesp, ob);
  880. }
  881. if (needType) WriteXsiType("XmlSchemaAppInfo", "http://www.w3.org/2001/XMLSchema");
  882. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  883. WriteAttribute ("source", "", ob.@Source);
  884. if (ob.@Markup != null) {
  885. foreach (XmlNode o186 in ob.@Markup) {
  886. XmlElement o187 = o186 as XmlElement;
  887. if (o187 == null) throw CreateUnknownTypeException (o187);
  888. WriteElementLiteral (o187, "", "", false, true);
  889. }
  890. }
  891. if (writeWrappingElem) WriteEndElement (ob);
  892. }
  893. void WriteObject_XmlSchemaDocumentation (System.Xml.Schema.XmlSchemaDocumentation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  894. {
  895. if (ob == null)
  896. {
  897. if (isNullable)
  898. WriteNullTagLiteral(element, namesp);
  899. return;
  900. }
  901. if (writeWrappingElem) {
  902. WriteStartElement (element, namesp, ob);
  903. }
  904. if (needType) WriteXsiType("XmlSchemaDocumentation", "http://www.w3.org/2001/XMLSchema");
  905. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  906. WriteAttribute ("xml:lang", "", ob.@Language);
  907. WriteAttribute ("source", "", ob.@Source);
  908. if (ob.@Markup != null) {
  909. foreach (XmlNode o188 in ob.@Markup) {
  910. XmlElement o189 = o188 as XmlElement;
  911. if (o189 == null) throw CreateUnknownTypeException (o189);
  912. WriteElementLiteral (o189, "", "", false, true);
  913. }
  914. }
  915. if (writeWrappingElem) WriteEndElement (ob);
  916. }
  917. void WriteObject_XmlSchemaSimpleContent (System.Xml.Schema.XmlSchemaSimpleContent ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  918. {
  919. if (ob == null)
  920. {
  921. if (isNullable)
  922. WriteNullTagLiteral(element, namesp);
  923. return;
  924. }
  925. if (writeWrappingElem) {
  926. WriteStartElement (element, namesp, ob);
  927. }
  928. if (needType) WriteXsiType("XmlSchemaSimpleContent", "http://www.w3.org/2001/XMLSchema");
  929. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  930. WriteAttribute ("id", "", ob.@Id);
  931. ICollection o190 = ob.@UnhandledAttributes;
  932. if (o190 != null) {
  933. foreach (XmlAttribute o191 in o190)
  934. WriteXmlAttribute (o191, ob);
  935. }
  936. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  937. if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleContentRestriction) {
  938. WriteObject_XmlSchemaSimpleContentRestriction (((System.Xml.Schema.XmlSchemaSimpleContentRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  939. }
  940. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleContentExtension) {
  941. WriteObject_XmlSchemaSimpleContentExtension (((System.Xml.Schema.XmlSchemaSimpleContentExtension) ob.@Content), "extension", "http://www.w3.org/2001/XMLSchema", false, false, true);
  942. }
  943. if (writeWrappingElem) WriteEndElement (ob);
  944. }
  945. void WriteObject_XmlSchemaComplexContent (System.Xml.Schema.XmlSchemaComplexContent ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  946. {
  947. if (ob == null)
  948. {
  949. if (isNullable)
  950. WriteNullTagLiteral(element, namesp);
  951. return;
  952. }
  953. if (writeWrappingElem) {
  954. WriteStartElement (element, namesp, ob);
  955. }
  956. if (needType) WriteXsiType("XmlSchemaComplexContent", "http://www.w3.org/2001/XMLSchema");
  957. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  958. WriteAttribute ("id", "", ob.@Id);
  959. WriteAttribute ("mixed", "", (ob.@IsMixed?"true":"false"));
  960. ICollection o192 = ob.@UnhandledAttributes;
  961. if (o192 != null) {
  962. foreach (XmlAttribute o193 in o192)
  963. WriteXmlAttribute (o193, ob);
  964. }
  965. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  966. if (ob.@Content is System.Xml.Schema.XmlSchemaComplexContentRestriction) {
  967. WriteObject_XmlSchemaComplexContentRestriction (((System.Xml.Schema.XmlSchemaComplexContentRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  968. }
  969. else if (ob.@Content is System.Xml.Schema.XmlSchemaComplexContentExtension) {
  970. WriteObject_XmlSchemaComplexContentExtension (((System.Xml.Schema.XmlSchemaComplexContentExtension) ob.@Content), "extension", "http://www.w3.org/2001/XMLSchema", false, false, true);
  971. }
  972. if (writeWrappingElem) WriteEndElement (ob);
  973. }
  974. void WriteObject_XmlSchemaGroupRef (System.Xml.Schema.XmlSchemaGroupRef ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  975. {
  976. if (ob == null)
  977. {
  978. if (isNullable)
  979. WriteNullTagLiteral(element, namesp);
  980. return;
  981. }
  982. if (writeWrappingElem) {
  983. WriteStartElement (element, namesp, ob);
  984. }
  985. if (needType) WriteXsiType("XmlSchemaGroupRef", "http://www.w3.org/2001/XMLSchema");
  986. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  987. WriteAttribute ("id", "", ob.@Id);
  988. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  989. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  990. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  991. ICollection o194 = ob.@UnhandledAttributes;
  992. if (o194 != null) {
  993. foreach (XmlAttribute o195 in o194)
  994. WriteXmlAttribute (o195, ob);
  995. }
  996. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  997. if (writeWrappingElem) WriteEndElement (ob);
  998. }
  999. void WriteObject_XmlSchemaSimpleTypeUnion (System.Xml.Schema.XmlSchemaSimpleTypeUnion ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1000. {
  1001. if (ob == null)
  1002. {
  1003. if (isNullable)
  1004. WriteNullTagLiteral(element, namesp);
  1005. return;
  1006. }
  1007. if (writeWrappingElem) {
  1008. WriteStartElement (element, namesp, ob);
  1009. }
  1010. if (needType) WriteXsiType("XmlSchemaSimpleTypeUnion", "http://www.w3.org/2001/XMLSchema");
  1011. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1012. WriteAttribute ("id", "", ob.@Id);
  1013. string s196 = null;
  1014. if (ob.@MemberTypes != null) {
  1015. System.Text.StringBuilder s197 = new System.Text.StringBuilder();
  1016. for (int n198 = 0; n198 < [email protected]; n198++) {
  1017. s197.Append (FromXmlQualifiedName (ob.@MemberTypes[n198])).Append (" ");
  1018. }
  1019. s196 = s197.ToString ().Trim ();
  1020. }
  1021. WriteAttribute ("memberTypes", "", s196);
  1022. ICollection o199 = ob.@UnhandledAttributes;
  1023. if (o199 != null) {
  1024. foreach (XmlAttribute o200 in o199)
  1025. WriteXmlAttribute (o200, ob);
  1026. }
  1027. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1028. if (ob.@BaseTypes != null) {
  1029. for (int n201 = 0; n201 < [email protected]; n201++) {
  1030. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@BaseTypes[n201]), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1031. }
  1032. }
  1033. if (writeWrappingElem) WriteEndElement (ob);
  1034. }
  1035. void WriteObject_XmlSchemaSimpleTypeList (System.Xml.Schema.XmlSchemaSimpleTypeList ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1036. {
  1037. if (ob == null)
  1038. {
  1039. if (isNullable)
  1040. WriteNullTagLiteral(element, namesp);
  1041. return;
  1042. }
  1043. if (writeWrappingElem) {
  1044. WriteStartElement (element, namesp, ob);
  1045. }
  1046. if (needType) WriteXsiType("XmlSchemaSimpleTypeList", "http://www.w3.org/2001/XMLSchema");
  1047. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1048. WriteAttribute ("id", "", ob.@Id);
  1049. WriteAttribute ("itemType", "", FromXmlQualifiedName (ob.@ItemTypeName));
  1050. ICollection o202 = ob.@UnhandledAttributes;
  1051. if (o202 != null) {
  1052. foreach (XmlAttribute o203 in o202)
  1053. WriteXmlAttribute (o203, ob);
  1054. }
  1055. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1056. WriteObject_XmlSchemaSimpleType (ob.@ItemType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1057. if (writeWrappingElem) WriteEndElement (ob);
  1058. }
  1059. void WriteObject_XmlSchemaSimpleTypeRestriction (System.Xml.Schema.XmlSchemaSimpleTypeRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1060. {
  1061. if (ob == null)
  1062. {
  1063. if (isNullable)
  1064. WriteNullTagLiteral(element, namesp);
  1065. return;
  1066. }
  1067. if (writeWrappingElem) {
  1068. WriteStartElement (element, namesp, ob);
  1069. }
  1070. if (needType) WriteXsiType("XmlSchemaSimpleTypeRestriction", "http://www.w3.org/2001/XMLSchema");
  1071. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1072. WriteAttribute ("id", "", ob.@Id);
  1073. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1074. ICollection o204 = ob.@UnhandledAttributes;
  1075. if (o204 != null) {
  1076. foreach (XmlAttribute o205 in o204)
  1077. WriteXmlAttribute (o205, ob);
  1078. }
  1079. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1080. WriteObject_XmlSchemaSimpleType (ob.@BaseType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1081. if (ob.@Facets != null) {
  1082. for (int n206 = 0; n206 < [email protected]; n206++) {
  1083. if (ob.@Facets[n206] == null) { }
  1084. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaPatternFacet)) {
  1085. WriteObject_XmlSchemaPatternFacet (((System.Xml.Schema.XmlSchemaPatternFacet) ob.@Facets[n206]), "pattern", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1086. }
  1087. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet)) {
  1088. WriteObject_XmlSchemaWhiteSpaceFacet (((System.Xml.Schema.XmlSchemaWhiteSpaceFacet) ob.@Facets[n206]), "whiteSpace", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1089. }
  1090. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet)) {
  1091. WriteObject_XmlSchemaEnumerationFacet (((System.Xml.Schema.XmlSchemaEnumerationFacet) ob.@Facets[n206]), "enumeration", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1092. }
  1093. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet)) {
  1094. WriteObject_XmlSchemaMaxLengthFacet (((System.Xml.Schema.XmlSchemaMaxLengthFacet) ob.@Facets[n206]), "maxLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1095. }
  1096. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet)) {
  1097. WriteObject_XmlSchemaMinLengthFacet (((System.Xml.Schema.XmlSchemaMinLengthFacet) ob.@Facets[n206]), "minLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1098. }
  1099. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaLengthFacet)) {
  1100. WriteObject_XmlSchemaLengthFacet (((System.Xml.Schema.XmlSchemaLengthFacet) ob.@Facets[n206]), "length", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1101. }
  1102. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet)) {
  1103. WriteObject_XmlSchemaFractionDigitsFacet (((System.Xml.Schema.XmlSchemaFractionDigitsFacet) ob.@Facets[n206]), "fractionDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1104. }
  1105. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet)) {
  1106. WriteObject_XmlSchemaTotalDigitsFacet (((System.Xml.Schema.XmlSchemaTotalDigitsFacet) ob.@Facets[n206]), "totalDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1107. }
  1108. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet)) {
  1109. WriteObject_XmlSchemaMaxInclusiveFacet (((System.Xml.Schema.XmlSchemaMaxInclusiveFacet) ob.@Facets[n206]), "maxInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1110. }
  1111. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet)) {
  1112. WriteObject_XmlSchemaMaxExclusiveFacet (((System.Xml.Schema.XmlSchemaMaxExclusiveFacet) ob.@Facets[n206]), "maxExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1113. }
  1114. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet)) {
  1115. WriteObject_XmlSchemaMinInclusiveFacet (((System.Xml.Schema.XmlSchemaMinInclusiveFacet) ob.@Facets[n206]), "minInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1116. }
  1117. else if (ob.@Facets[n206].GetType() == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet)) {
  1118. WriteObject_XmlSchemaMinExclusiveFacet (((System.Xml.Schema.XmlSchemaMinExclusiveFacet) ob.@Facets[n206]), "minExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1119. }
  1120. else throw CreateUnknownTypeException (ob.@Facets[n206]);
  1121. }
  1122. }
  1123. if (writeWrappingElem) WriteEndElement (ob);
  1124. }
  1125. void WriteObject_XmlSchemaXPath (System.Xml.Schema.XmlSchemaXPath ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1126. {
  1127. if (ob == null)
  1128. {
  1129. if (isNullable)
  1130. WriteNullTagLiteral(element, namesp);
  1131. return;
  1132. }
  1133. if (writeWrappingElem) {
  1134. WriteStartElement (element, namesp, ob);
  1135. }
  1136. if (needType) WriteXsiType("XmlSchemaXPath", "http://www.w3.org/2001/XMLSchema");
  1137. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1138. WriteAttribute ("id", "", ob.@Id);
  1139. if (ob.@XPath != null) {
  1140. WriteAttribute ("xpath", "", ob.@XPath);
  1141. }
  1142. ICollection o207 = ob.@UnhandledAttributes;
  1143. if (o207 != null) {
  1144. foreach (XmlAttribute o208 in o207)
  1145. WriteXmlAttribute (o208, ob);
  1146. }
  1147. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1148. if (writeWrappingElem) WriteEndElement (ob);
  1149. }
  1150. void WriteObject_XmlSchemaContentProcessing (System.Xml.Schema.XmlSchemaContentProcessing ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1151. {
  1152. if (writeWrappingElem) {
  1153. WriteStartElement (element, namesp, ob);
  1154. }
  1155. if (needType) WriteXsiType("XmlSchemaContentProcessing", "");
  1156. Writer.WriteString (GetEnumValue_XmlSchemaContentProcessing (ob));
  1157. if (writeWrappingElem) WriteEndElement (ob);
  1158. }
  1159. string GetEnumValue_XmlSchemaContentProcessing (System.Xml.Schema.XmlSchemaContentProcessing val)
  1160. {
  1161. switch (val)
  1162. {
  1163. case System.Xml.Schema.XmlSchemaContentProcessing.Skip: return "skip";
  1164. case System.Xml.Schema.XmlSchemaContentProcessing.Lax: return "lax";
  1165. case System.Xml.Schema.XmlSchemaContentProcessing.Strict: return "strict";
  1166. default: return ((long)val).ToString();
  1167. }
  1168. }
  1169. void WriteObject_XmlSchemaAny (System.Xml.Schema.XmlSchemaAny ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1170. {
  1171. if (ob == null)
  1172. {
  1173. if (isNullable)
  1174. WriteNullTagLiteral(element, namesp);
  1175. return;
  1176. }
  1177. if (writeWrappingElem) {
  1178. WriteStartElement (element, namesp, ob);
  1179. }
  1180. if (needType) WriteXsiType("XmlSchemaAny", "http://www.w3.org/2001/XMLSchema");
  1181. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1182. WriteAttribute ("id", "", ob.@Id);
  1183. if (ob.@ProcessContents != ((System.Xml.Schema.XmlSchemaContentProcessing) 0)) {
  1184. WriteAttribute ("processContents", "", GetEnumValue_XmlSchemaContentProcessing (ob.@ProcessContents));
  1185. }
  1186. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1187. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1188. WriteAttribute ("namespace", "", ob.@Namespace);
  1189. ICollection o209 = ob.@UnhandledAttributes;
  1190. if (o209 != null) {
  1191. foreach (XmlAttribute o210 in o209)
  1192. WriteXmlAttribute (o210, ob);
  1193. }
  1194. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1195. if (writeWrappingElem) WriteEndElement (ob);
  1196. }
  1197. void WriteObject_XmlSchemaSimpleContentRestriction (System.Xml.Schema.XmlSchemaSimpleContentRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1198. {
  1199. if (ob == null)
  1200. {
  1201. if (isNullable)
  1202. WriteNullTagLiteral(element, namesp);
  1203. return;
  1204. }
  1205. if (writeWrappingElem) {
  1206. WriteStartElement (element, namesp, ob);
  1207. }
  1208. if (needType) WriteXsiType("XmlSchemaSimpleContentRestriction", "http://www.w3.org/2001/XMLSchema");
  1209. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1210. WriteAttribute ("id", "", ob.@Id);
  1211. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1212. ICollection o211 = ob.@UnhandledAttributes;
  1213. if (o211 != null) {
  1214. foreach (XmlAttribute o212 in o211)
  1215. WriteXmlAttribute (o212, ob);
  1216. }
  1217. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1218. WriteObject_XmlSchemaSimpleType (ob.@BaseType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1219. if (ob.@Facets != null) {
  1220. for (int n213 = 0; n213 < [email protected]; n213++) {
  1221. if (ob.@Facets[n213] == null) { }
  1222. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaPatternFacet)) {
  1223. WriteObject_XmlSchemaPatternFacet (((System.Xml.Schema.XmlSchemaPatternFacet) ob.@Facets[n213]), "pattern", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1224. }
  1225. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet)) {
  1226. WriteObject_XmlSchemaWhiteSpaceFacet (((System.Xml.Schema.XmlSchemaWhiteSpaceFacet) ob.@Facets[n213]), "whiteSpace", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1227. }
  1228. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet)) {
  1229. WriteObject_XmlSchemaEnumerationFacet (((System.Xml.Schema.XmlSchemaEnumerationFacet) ob.@Facets[n213]), "enumeration", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1230. }
  1231. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet)) {
  1232. WriteObject_XmlSchemaMaxLengthFacet (((System.Xml.Schema.XmlSchemaMaxLengthFacet) ob.@Facets[n213]), "maxLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1233. }
  1234. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet)) {
  1235. WriteObject_XmlSchemaMinLengthFacet (((System.Xml.Schema.XmlSchemaMinLengthFacet) ob.@Facets[n213]), "minLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1236. }
  1237. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaLengthFacet)) {
  1238. WriteObject_XmlSchemaLengthFacet (((System.Xml.Schema.XmlSchemaLengthFacet) ob.@Facets[n213]), "length", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1239. }
  1240. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet)) {
  1241. WriteObject_XmlSchemaFractionDigitsFacet (((System.Xml.Schema.XmlSchemaFractionDigitsFacet) ob.@Facets[n213]), "fractionDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1242. }
  1243. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet)) {
  1244. WriteObject_XmlSchemaTotalDigitsFacet (((System.Xml.Schema.XmlSchemaTotalDigitsFacet) ob.@Facets[n213]), "totalDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1245. }
  1246. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet)) {
  1247. WriteObject_XmlSchemaMaxInclusiveFacet (((System.Xml.Schema.XmlSchemaMaxInclusiveFacet) ob.@Facets[n213]), "maxInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1248. }
  1249. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet)) {
  1250. WriteObject_XmlSchemaMaxExclusiveFacet (((System.Xml.Schema.XmlSchemaMaxExclusiveFacet) ob.@Facets[n213]), "maxExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1251. }
  1252. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet)) {
  1253. WriteObject_XmlSchemaMinInclusiveFacet (((System.Xml.Schema.XmlSchemaMinInclusiveFacet) ob.@Facets[n213]), "minInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1254. }
  1255. else if (ob.@Facets[n213].GetType() == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet)) {
  1256. WriteObject_XmlSchemaMinExclusiveFacet (((System.Xml.Schema.XmlSchemaMinExclusiveFacet) ob.@Facets[n213]), "minExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1257. }
  1258. else throw CreateUnknownTypeException (ob.@Facets[n213]);
  1259. }
  1260. }
  1261. if (ob.@Attributes != null) {
  1262. for (int n214 = 0; n214 < [email protected]; n214++) {
  1263. if (ob.@Attributes[n214] == null) { }
  1264. else if (ob.@Attributes[n214].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1265. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n214]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1266. }
  1267. else if (ob.@Attributes[n214].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1268. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n214]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1269. }
  1270. else throw CreateUnknownTypeException (ob.@Attributes[n214]);
  1271. }
  1272. }
  1273. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1274. if (writeWrappingElem) WriteEndElement (ob);
  1275. }
  1276. void WriteObject_XmlSchemaSimpleContentExtension (System.Xml.Schema.XmlSchemaSimpleContentExtension ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1277. {
  1278. if (ob == null)
  1279. {
  1280. if (isNullable)
  1281. WriteNullTagLiteral(element, namesp);
  1282. return;
  1283. }
  1284. if (writeWrappingElem) {
  1285. WriteStartElement (element, namesp, ob);
  1286. }
  1287. if (needType) WriteXsiType("XmlSchemaSimpleContentExtension", "http://www.w3.org/2001/XMLSchema");
  1288. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1289. WriteAttribute ("id", "", ob.@Id);
  1290. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1291. ICollection o215 = ob.@UnhandledAttributes;
  1292. if (o215 != null) {
  1293. foreach (XmlAttribute o216 in o215)
  1294. WriteXmlAttribute (o216, ob);
  1295. }
  1296. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1297. if (ob.@Attributes != null) {
  1298. for (int n217 = 0; n217 < [email protected]; n217++) {
  1299. if (ob.@Attributes[n217] == null) { }
  1300. else if (ob.@Attributes[n217].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1301. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n217]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1302. }
  1303. else if (ob.@Attributes[n217].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1304. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n217]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1305. }
  1306. else throw CreateUnknownTypeException (ob.@Attributes[n217]);
  1307. }
  1308. }
  1309. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1310. if (writeWrappingElem) WriteEndElement (ob);
  1311. }
  1312. void WriteObject_XmlSchemaComplexContentRestriction (System.Xml.Schema.XmlSchemaComplexContentRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1313. {
  1314. if (ob == null)
  1315. {
  1316. if (isNullable)
  1317. WriteNullTagLiteral(element, namesp);
  1318. return;
  1319. }
  1320. if (writeWrappingElem) {
  1321. WriteStartElement (element, namesp, ob);
  1322. }
  1323. if (needType) WriteXsiType("XmlSchemaComplexContentRestriction", "http://www.w3.org/2001/XMLSchema");
  1324. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1325. WriteAttribute ("id", "", ob.@Id);
  1326. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1327. ICollection o218 = ob.@UnhandledAttributes;
  1328. if (o218 != null) {
  1329. foreach (XmlAttribute o219 in o218)
  1330. WriteXmlAttribute (o219, ob);
  1331. }
  1332. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1333. if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  1334. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1335. }
  1336. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  1337. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1338. }
  1339. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  1340. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1341. }
  1342. else if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  1343. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1344. }
  1345. if (ob.@Attributes != null) {
  1346. for (int n220 = 0; n220 < [email protected]; n220++) {
  1347. if (ob.@Attributes[n220] == null) { }
  1348. else if (ob.@Attributes[n220].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1349. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n220]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1350. }
  1351. else if (ob.@Attributes[n220].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1352. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n220]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1353. }
  1354. else throw CreateUnknownTypeException (ob.@Attributes[n220]);
  1355. }
  1356. }
  1357. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1358. if (writeWrappingElem) WriteEndElement (ob);
  1359. }
  1360. void WriteObject_XmlSchemaComplexContentExtension (System.Xml.Schema.XmlSchemaComplexContentExtension ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1361. {
  1362. if (ob == null)
  1363. {
  1364. if (isNullable)
  1365. WriteNullTagLiteral(element, namesp);
  1366. return;
  1367. }
  1368. if (writeWrappingElem) {
  1369. WriteStartElement (element, namesp, ob);
  1370. }
  1371. if (needType) WriteXsiType("XmlSchemaComplexContentExtension", "http://www.w3.org/2001/XMLSchema");
  1372. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1373. WriteAttribute ("id", "", ob.@Id);
  1374. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1375. ICollection o221 = ob.@UnhandledAttributes;
  1376. if (o221 != null) {
  1377. foreach (XmlAttribute o222 in o221)
  1378. WriteXmlAttribute (o222, ob);
  1379. }
  1380. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1381. if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  1382. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1383. }
  1384. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  1385. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1386. }
  1387. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  1388. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1389. }
  1390. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  1391. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1392. }
  1393. if (ob.@Attributes != null) {
  1394. for (int n223 = 0; n223 < [email protected]; n223++) {
  1395. if (ob.@Attributes[n223] == null) { }
  1396. else if (ob.@Attributes[n223].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1397. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n223]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1398. }
  1399. else if (ob.@Attributes[n223].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1400. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n223]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1401. }
  1402. else throw CreateUnknownTypeException (ob.@Attributes[n223]);
  1403. }
  1404. }
  1405. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1406. if (writeWrappingElem) WriteEndElement (ob);
  1407. }
  1408. void WriteObject_XmlSchemaPatternFacet (System.Xml.Schema.XmlSchemaPatternFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1409. {
  1410. if (ob == null)
  1411. {
  1412. if (isNullable)
  1413. WriteNullTagLiteral(element, namesp);
  1414. return;
  1415. }
  1416. if (writeWrappingElem) {
  1417. WriteStartElement (element, namesp, ob);
  1418. }
  1419. if (needType) WriteXsiType("XmlSchemaPatternFacet", "http://www.w3.org/2001/XMLSchema");
  1420. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1421. WriteAttribute ("id", "", ob.@Id);
  1422. WriteAttribute ("value", "", ob.@Value);
  1423. if (ob.@IsFixed != false) {
  1424. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1425. }
  1426. ICollection o224 = ob.@UnhandledAttributes;
  1427. if (o224 != null) {
  1428. foreach (XmlAttribute o225 in o224)
  1429. WriteXmlAttribute (o225, ob);
  1430. }
  1431. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1432. if (writeWrappingElem) WriteEndElement (ob);
  1433. }
  1434. void WriteObject_XmlSchemaWhiteSpaceFacet (System.Xml.Schema.XmlSchemaWhiteSpaceFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1435. {
  1436. if (ob == null)
  1437. {
  1438. if (isNullable)
  1439. WriteNullTagLiteral(element, namesp);
  1440. return;
  1441. }
  1442. if (writeWrappingElem) {
  1443. WriteStartElement (element, namesp, ob);
  1444. }
  1445. if (needType) WriteXsiType("XmlSchemaWhiteSpaceFacet", "http://www.w3.org/2001/XMLSchema");
  1446. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1447. WriteAttribute ("id", "", ob.@Id);
  1448. WriteAttribute ("value", "", ob.@Value);
  1449. if (ob.@IsFixed != false) {
  1450. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1451. }
  1452. ICollection o226 = ob.@UnhandledAttributes;
  1453. if (o226 != null) {
  1454. foreach (XmlAttribute o227 in o226)
  1455. WriteXmlAttribute (o227, ob);
  1456. }
  1457. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1458. if (writeWrappingElem) WriteEndElement (ob);
  1459. }
  1460. void WriteObject_XmlSchemaEnumerationFacet (System.Xml.Schema.XmlSchemaEnumerationFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1461. {
  1462. if (ob == null)
  1463. {
  1464. if (isNullable)
  1465. WriteNullTagLiteral(element, namesp);
  1466. return;
  1467. }
  1468. if (writeWrappingElem) {
  1469. WriteStartElement (element, namesp, ob);
  1470. }
  1471. if (needType) WriteXsiType("XmlSchemaEnumerationFacet", "http://www.w3.org/2001/XMLSchema");
  1472. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1473. WriteAttribute ("id", "", ob.@Id);
  1474. WriteAttribute ("value", "", ob.@Value);
  1475. if (ob.@IsFixed != false) {
  1476. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1477. }
  1478. ICollection o228 = ob.@UnhandledAttributes;
  1479. if (o228 != null) {
  1480. foreach (XmlAttribute o229 in o228)
  1481. WriteXmlAttribute (o229, ob);
  1482. }
  1483. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1484. if (writeWrappingElem) WriteEndElement (ob);
  1485. }
  1486. void WriteObject_XmlSchemaMaxLengthFacet (System.Xml.Schema.XmlSchemaMaxLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1487. {
  1488. if (ob == null)
  1489. {
  1490. if (isNullable)
  1491. WriteNullTagLiteral(element, namesp);
  1492. return;
  1493. }
  1494. if (writeWrappingElem) {
  1495. WriteStartElement (element, namesp, ob);
  1496. }
  1497. if (needType) WriteXsiType("XmlSchemaMaxLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1498. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1499. WriteAttribute ("id", "", ob.@Id);
  1500. WriteAttribute ("value", "", ob.@Value);
  1501. if (ob.@IsFixed != false) {
  1502. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1503. }
  1504. ICollection o230 = ob.@UnhandledAttributes;
  1505. if (o230 != null) {
  1506. foreach (XmlAttribute o231 in o230)
  1507. WriteXmlAttribute (o231, ob);
  1508. }
  1509. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1510. if (writeWrappingElem) WriteEndElement (ob);
  1511. }
  1512. void WriteObject_XmlSchemaMinLengthFacet (System.Xml.Schema.XmlSchemaMinLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1513. {
  1514. if (ob == null)
  1515. {
  1516. if (isNullable)
  1517. WriteNullTagLiteral(element, namesp);
  1518. return;
  1519. }
  1520. if (writeWrappingElem) {
  1521. WriteStartElement (element, namesp, ob);
  1522. }
  1523. if (needType) WriteXsiType("XmlSchemaMinLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1524. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1525. WriteAttribute ("id", "", ob.@Id);
  1526. WriteAttribute ("value", "", ob.@Value);
  1527. if (ob.@IsFixed != false) {
  1528. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1529. }
  1530. ICollection o232 = ob.@UnhandledAttributes;
  1531. if (o232 != null) {
  1532. foreach (XmlAttribute o233 in o232)
  1533. WriteXmlAttribute (o233, ob);
  1534. }
  1535. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1536. if (writeWrappingElem) WriteEndElement (ob);
  1537. }
  1538. void WriteObject_XmlSchemaLengthFacet (System.Xml.Schema.XmlSchemaLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1539. {
  1540. if (ob == null)
  1541. {
  1542. if (isNullable)
  1543. WriteNullTagLiteral(element, namesp);
  1544. return;
  1545. }
  1546. if (writeWrappingElem) {
  1547. WriteStartElement (element, namesp, ob);
  1548. }
  1549. if (needType) WriteXsiType("XmlSchemaLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1550. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1551. WriteAttribute ("id", "", ob.@Id);
  1552. WriteAttribute ("value", "", ob.@Value);
  1553. if (ob.@IsFixed != false) {
  1554. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1555. }
  1556. ICollection o234 = ob.@UnhandledAttributes;
  1557. if (o234 != null) {
  1558. foreach (XmlAttribute o235 in o234)
  1559. WriteXmlAttribute (o235, ob);
  1560. }
  1561. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1562. if (writeWrappingElem) WriteEndElement (ob);
  1563. }
  1564. void WriteObject_XmlSchemaFractionDigitsFacet (System.Xml.Schema.XmlSchemaFractionDigitsFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1565. {
  1566. if (ob == null)
  1567. {
  1568. if (isNullable)
  1569. WriteNullTagLiteral(element, namesp);
  1570. return;
  1571. }
  1572. if (writeWrappingElem) {
  1573. WriteStartElement (element, namesp, ob);
  1574. }
  1575. if (needType) WriteXsiType("XmlSchemaFractionDigitsFacet", "http://www.w3.org/2001/XMLSchema");
  1576. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1577. WriteAttribute ("id", "", ob.@Id);
  1578. WriteAttribute ("value", "", ob.@Value);
  1579. if (ob.@IsFixed != false) {
  1580. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1581. }
  1582. ICollection o236 = ob.@UnhandledAttributes;
  1583. if (o236 != null) {
  1584. foreach (XmlAttribute o237 in o236)
  1585. WriteXmlAttribute (o237, ob);
  1586. }
  1587. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1588. if (writeWrappingElem) WriteEndElement (ob);
  1589. }
  1590. void WriteObject_XmlSchemaTotalDigitsFacet (System.Xml.Schema.XmlSchemaTotalDigitsFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1591. {
  1592. if (ob == null)
  1593. {
  1594. if (isNullable)
  1595. WriteNullTagLiteral(element, namesp);
  1596. return;
  1597. }
  1598. if (writeWrappingElem) {
  1599. WriteStartElement (element, namesp, ob);
  1600. }
  1601. if (needType) WriteXsiType("XmlSchemaTotalDigitsFacet", "http://www.w3.org/2001/XMLSchema");
  1602. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1603. WriteAttribute ("id", "", ob.@Id);
  1604. WriteAttribute ("value", "", ob.@Value);
  1605. if (ob.@IsFixed != false) {
  1606. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1607. }
  1608. ICollection o238 = ob.@UnhandledAttributes;
  1609. if (o238 != null) {
  1610. foreach (XmlAttribute o239 in o238)
  1611. WriteXmlAttribute (o239, ob);
  1612. }
  1613. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1614. if (writeWrappingElem) WriteEndElement (ob);
  1615. }
  1616. void WriteObject_XmlSchemaMaxInclusiveFacet (System.Xml.Schema.XmlSchemaMaxInclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1617. {
  1618. if (ob == null)
  1619. {
  1620. if (isNullable)
  1621. WriteNullTagLiteral(element, namesp);
  1622. return;
  1623. }
  1624. if (writeWrappingElem) {
  1625. WriteStartElement (element, namesp, ob);
  1626. }
  1627. if (needType) WriteXsiType("XmlSchemaMaxInclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1628. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1629. WriteAttribute ("id", "", ob.@Id);
  1630. WriteAttribute ("value", "", ob.@Value);
  1631. if (ob.@IsFixed != false) {
  1632. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1633. }
  1634. ICollection o240 = ob.@UnhandledAttributes;
  1635. if (o240 != null) {
  1636. foreach (XmlAttribute o241 in o240)
  1637. WriteXmlAttribute (o241, ob);
  1638. }
  1639. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1640. if (writeWrappingElem) WriteEndElement (ob);
  1641. }
  1642. void WriteObject_XmlSchemaMaxExclusiveFacet (System.Xml.Schema.XmlSchemaMaxExclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1643. {
  1644. if (ob == null)
  1645. {
  1646. if (isNullable)
  1647. WriteNullTagLiteral(element, namesp);
  1648. return;
  1649. }
  1650. if (writeWrappingElem) {
  1651. WriteStartElement (element, namesp, ob);
  1652. }
  1653. if (needType) WriteXsiType("XmlSchemaMaxExclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1654. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1655. WriteAttribute ("id", "", ob.@Id);
  1656. WriteAttribute ("value", "", ob.@Value);
  1657. if (ob.@IsFixed != false) {
  1658. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1659. }
  1660. ICollection o242 = ob.@UnhandledAttributes;
  1661. if (o242 != null) {
  1662. foreach (XmlAttribute o243 in o242)
  1663. WriteXmlAttribute (o243, ob);
  1664. }
  1665. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1666. if (writeWrappingElem) WriteEndElement (ob);
  1667. }
  1668. void WriteObject_XmlSchemaMinInclusiveFacet (System.Xml.Schema.XmlSchemaMinInclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1669. {
  1670. if (ob == null)
  1671. {
  1672. if (isNullable)
  1673. WriteNullTagLiteral(element, namesp);
  1674. return;
  1675. }
  1676. if (writeWrappingElem) {
  1677. WriteStartElement (element, namesp, ob);
  1678. }
  1679. if (needType) WriteXsiType("XmlSchemaMinInclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1680. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1681. WriteAttribute ("id", "", ob.@Id);
  1682. WriteAttribute ("value", "", ob.@Value);
  1683. if (ob.@IsFixed != false) {
  1684. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1685. }
  1686. ICollection o244 = ob.@UnhandledAttributes;
  1687. if (o244 != null) {
  1688. foreach (XmlAttribute o245 in o244)
  1689. WriteXmlAttribute (o245, ob);
  1690. }
  1691. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1692. if (writeWrappingElem) WriteEndElement (ob);
  1693. }
  1694. void WriteObject_XmlSchemaMinExclusiveFacet (System.Xml.Schema.XmlSchemaMinExclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1695. {
  1696. if (ob == null)
  1697. {
  1698. if (isNullable)
  1699. WriteNullTagLiteral(element, namesp);
  1700. return;
  1701. }
  1702. if (writeWrappingElem) {
  1703. WriteStartElement (element, namesp, ob);
  1704. }
  1705. if (needType) WriteXsiType("XmlSchemaMinExclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1706. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1707. WriteAttribute ("id", "", ob.@Id);
  1708. WriteAttribute ("value", "", ob.@Value);
  1709. if (ob.@IsFixed != false) {
  1710. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1711. }
  1712. ICollection o246 = ob.@UnhandledAttributes;
  1713. if (o246 != null) {
  1714. foreach (XmlAttribute o247 in o246)
  1715. WriteXmlAttribute (o247, ob);
  1716. }
  1717. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1718. if (writeWrappingElem) WriteEndElement (ob);
  1719. }
  1720. protected override void InitCallbacks ()
  1721. {
  1722. }
  1723. }
  1724. }