CustomSerializer.cs 86 KB

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