XmlSchemaSerializer.cs 95 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452
  1. using System;
  2. using System.Xml;
  3. using System.Xml.Schema;
  4. using System.Xml.Serialization;
  5. using System.Text;
  6. using System.Collections;
  7. using System.Globalization;
  8. namespace System.Xml.Schema
  9. {
  10. internal class XmlSchemaSerializationWriter : XmlSerializationWriter
  11. {
  12. const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
  13. public void WriteRoot_XmlSchema (object o)
  14. {
  15. WriteStartDocument ();
  16. System.Xml.Schema.XmlSchema ob = (System.Xml.Schema.XmlSchema) o;
  17. TopLevelElement ();
  18. WriteObject_XmlSchema (ob, "schema", "http://www.w3.org/2001/XMLSchema", true, false, true);
  19. }
  20. void WriteObject_XmlSchema (System.Xml.Schema.XmlSchema ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  21. {
  22. if (ob == null)
  23. {
  24. if (isNullable)
  25. WriteNullTagLiteral(element, namesp);
  26. return;
  27. }
  28. System.Type type = ob.GetType ();
  29. if (type == typeof(System.Xml.Schema.XmlSchema))
  30. ;
  31. else {
  32. throw CreateUnknownTypeException (ob);
  33. }
  34. if (writeWrappingElem) {
  35. WriteStartElement (element, namesp, ob);
  36. }
  37. if (needType) WriteXsiType("XmlSchema", "http://www.w3.org/2001/XMLSchema");
  38. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  39. ICollection o0 = ob.@UnhandledAttributes;
  40. if (o0 != null) {
  41. foreach (XmlAttribute o1 in o0)
  42. if (o1.NamespaceURI != xmlNamespace)
  43. WriteXmlAttribute (o1, ob);
  44. }
  45. if (ob.@AttributeFormDefault != ((System.Xml.Schema.XmlSchemaForm) System.Xml.Schema.XmlSchemaForm.None)) {
  46. WriteAttribute ("attributeFormDefault", "", GetEnumValue_XmlSchemaForm (ob.@AttributeFormDefault));
  47. }
  48. if (ob.@BlockDefault != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  49. WriteAttribute ("blockDefault", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@BlockDefault));
  50. }
  51. if (ob.@FinalDefault != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  52. WriteAttribute ("finalDefault", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@FinalDefault));
  53. }
  54. if (ob.@ElementFormDefault != ((System.Xml.Schema.XmlSchemaForm) System.Xml.Schema.XmlSchemaForm.None)) {
  55. WriteAttribute ("elementFormDefault", "", GetEnumValue_XmlSchemaForm (ob.@ElementFormDefault));
  56. }
  57. WriteAttribute ("targetNamespace", "", ob.@TargetNamespace);
  58. WriteAttribute ("version", "", ob.@Version);
  59. WriteAttribute ("id", "", ob.@Id);
  60. if (ob.@Includes != null) {
  61. for (int n2 = 0; n2 < [email protected]; n2++) {
  62. if (ob.@Includes[n2] == null) { }
  63. else if (ob.@Includes[n2].GetType() == typeof(System.Xml.Schema.XmlSchemaInclude)) {
  64. WriteObject_XmlSchemaInclude (((System.Xml.Schema.XmlSchemaInclude) ob.@Includes[n2]), "include", "http://www.w3.org/2001/XMLSchema", false, false, true);
  65. }
  66. else if (ob.@Includes[n2].GetType() == typeof(System.Xml.Schema.XmlSchemaImport)) {
  67. WriteObject_XmlSchemaImport (((System.Xml.Schema.XmlSchemaImport) ob.@Includes[n2]), "import", "http://www.w3.org/2001/XMLSchema", false, false, true);
  68. }
  69. else if (ob.@Includes[n2].GetType() == typeof(System.Xml.Schema.XmlSchemaRedefine)) {
  70. WriteObject_XmlSchemaRedefine (((System.Xml.Schema.XmlSchemaRedefine) ob.@Includes[n2]), "redefine", "http://www.w3.org/2001/XMLSchema", false, false, true);
  71. }
  72. else throw CreateUnknownTypeException (ob.@Includes[n2]);
  73. }
  74. }
  75. if (ob.@Items != null) {
  76. for (int n3 = 0; n3 < [email protected]; n3++) {
  77. if (ob.@Items[n3] == null) { }
  78. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  79. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n3]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  80. }
  81. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaSimpleType)) {
  82. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@Items[n3]), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  83. }
  84. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  85. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Items[n3]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  86. }
  87. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaAnnotation)) {
  88. WriteObject_XmlSchemaAnnotation (((System.Xml.Schema.XmlSchemaAnnotation) ob.@Items[n3]), "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  89. }
  90. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroup)) {
  91. WriteObject_XmlSchemaAttributeGroup (((System.Xml.Schema.XmlSchemaAttributeGroup) ob.@Items[n3]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  92. }
  93. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaGroup)) {
  94. WriteObject_XmlSchemaGroup (((System.Xml.Schema.XmlSchemaGroup) ob.@Items[n3]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  95. }
  96. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaComplexType)) {
  97. WriteObject_XmlSchemaComplexType (((System.Xml.Schema.XmlSchemaComplexType) ob.@Items[n3]), "complexType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  98. }
  99. else if (ob.@Items[n3].GetType() == typeof(System.Xml.Schema.XmlSchemaNotation)) {
  100. WriteObject_XmlSchemaNotation (((System.Xml.Schema.XmlSchemaNotation) ob.@Items[n3]), "notation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  101. }
  102. else throw CreateUnknownTypeException (ob.@Items[n3]);
  103. }
  104. }
  105. if (writeWrappingElem) WriteEndElement (ob);
  106. }
  107. void WriteObject_XmlSchemaForm (System.Xml.Schema.XmlSchemaForm ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  108. {
  109. System.Type type = ob.GetType ();
  110. if (type == typeof(System.Xml.Schema.XmlSchemaForm))
  111. ;
  112. else {
  113. throw CreateUnknownTypeException (ob);
  114. }
  115. if (writeWrappingElem) {
  116. WriteStartElement (element, namesp, ob);
  117. }
  118. if (needType) WriteXsiType("XmlSchemaForm", "");
  119. Writer.WriteString (GetEnumValue_XmlSchemaForm (ob));
  120. if (writeWrappingElem) WriteEndElement (ob);
  121. }
  122. string GetEnumValue_XmlSchemaForm (System.Xml.Schema.XmlSchemaForm val)
  123. {
  124. switch (val)
  125. {
  126. case System.Xml.Schema.XmlSchemaForm.Qualified: return "qualified";
  127. case System.Xml.Schema.XmlSchemaForm.Unqualified: return "unqualified";
  128. default: return ((long)val).ToString(CultureInfo.InvariantCulture);
  129. }
  130. }
  131. void WriteObject_XmlSchemaDerivationMethod (System.Xml.Schema.XmlSchemaDerivationMethod ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  132. {
  133. System.Type type = ob.GetType ();
  134. if (type == typeof(System.Xml.Schema.XmlSchemaDerivationMethod))
  135. ;
  136. else {
  137. throw CreateUnknownTypeException (ob);
  138. }
  139. if (writeWrappingElem) {
  140. WriteStartElement (element, namesp, ob);
  141. }
  142. if (needType) WriteXsiType("XmlSchemaDerivationMethod", "");
  143. Writer.WriteString (GetEnumValue_XmlSchemaDerivationMethod (ob));
  144. if (writeWrappingElem) WriteEndElement (ob);
  145. }
  146. string GetEnumValue_XmlSchemaDerivationMethod (System.Xml.Schema.XmlSchemaDerivationMethod val)
  147. {
  148. switch (val)
  149. {
  150. case System.Xml.Schema.XmlSchemaDerivationMethod.Empty: return "";
  151. case System.Xml.Schema.XmlSchemaDerivationMethod.Substitution: return "substitution";
  152. case System.Xml.Schema.XmlSchemaDerivationMethod.Extension: return "extension";
  153. case System.Xml.Schema.XmlSchemaDerivationMethod.Restriction: return "restriction";
  154. case System.Xml.Schema.XmlSchemaDerivationMethod.List: return "list";
  155. case System.Xml.Schema.XmlSchemaDerivationMethod.Union: return "union";
  156. case System.Xml.Schema.XmlSchemaDerivationMethod.All: return "#all";
  157. default:
  158. System.Text.StringBuilder sb = new System.Text.StringBuilder ();
  159. string[] enumNames = val.ToString().Split (',');
  160. foreach (string name in enumNames)
  161. {
  162. switch (name.Trim())
  163. {
  164. case "Empty": sb.Append ("").Append (' '); break;
  165. case "Substitution": sb.Append ("substitution").Append (' '); break;
  166. case "Extension": sb.Append ("extension").Append (' '); break;
  167. case "Restriction": sb.Append ("restriction").Append (' '); break;
  168. case "List": sb.Append ("list").Append (' '); break;
  169. case "Union": sb.Append ("union").Append (' '); break;
  170. case "All": sb.Append ("#all").Append (' '); break;
  171. default: sb.Append (name.Trim()).Append (' '); break;
  172. }
  173. }
  174. return sb.ToString ().Trim();
  175. }
  176. }
  177. void WriteObject_XmlSchemaInclude (System.Xml.Schema.XmlSchemaInclude ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  178. {
  179. if (ob == null)
  180. {
  181. if (isNullable)
  182. WriteNullTagLiteral(element, namesp);
  183. return;
  184. }
  185. System.Type type = ob.GetType ();
  186. if (type == typeof(System.Xml.Schema.XmlSchemaInclude))
  187. ;
  188. else {
  189. throw CreateUnknownTypeException (ob);
  190. }
  191. if (writeWrappingElem) {
  192. WriteStartElement (element, namesp, ob);
  193. }
  194. if (needType) WriteXsiType("XmlSchemaInclude", "http://www.w3.org/2001/XMLSchema");
  195. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  196. ICollection o4 = ob.@UnhandledAttributes;
  197. if (o4 != null) {
  198. foreach (XmlAttribute o5 in o4)
  199. if (o5.NamespaceURI != xmlNamespace)
  200. WriteXmlAttribute (o5, ob);
  201. }
  202. WriteAttribute ("schemaLocation", "", ob.@SchemaLocation);
  203. WriteAttribute ("id", "", ob.@Id);
  204. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  205. if (writeWrappingElem) WriteEndElement (ob);
  206. }
  207. void WriteObject_XmlSchemaImport (System.Xml.Schema.XmlSchemaImport ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  208. {
  209. if (ob == null)
  210. {
  211. if (isNullable)
  212. WriteNullTagLiteral(element, namesp);
  213. return;
  214. }
  215. System.Type type = ob.GetType ();
  216. if (type == typeof(System.Xml.Schema.XmlSchemaImport))
  217. ;
  218. else {
  219. throw CreateUnknownTypeException (ob);
  220. }
  221. if (writeWrappingElem) {
  222. WriteStartElement (element, namesp, ob);
  223. }
  224. if (needType) WriteXsiType("XmlSchemaImport", "http://www.w3.org/2001/XMLSchema");
  225. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  226. ICollection o6 = ob.@UnhandledAttributes;
  227. if (o6 != null) {
  228. foreach (XmlAttribute o7 in o6)
  229. if (o7.NamespaceURI != xmlNamespace)
  230. WriteXmlAttribute (o7, ob);
  231. }
  232. WriteAttribute ("schemaLocation", "", ob.@SchemaLocation);
  233. WriteAttribute ("id", "", ob.@Id);
  234. WriteAttribute ("namespace", "", ob.@Namespace);
  235. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  236. if (writeWrappingElem) WriteEndElement (ob);
  237. }
  238. void WriteObject_XmlSchemaRedefine (System.Xml.Schema.XmlSchemaRedefine ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  239. {
  240. if (ob == null)
  241. {
  242. if (isNullable)
  243. WriteNullTagLiteral(element, namesp);
  244. return;
  245. }
  246. System.Type type = ob.GetType ();
  247. if (type == typeof(System.Xml.Schema.XmlSchemaRedefine))
  248. ;
  249. else {
  250. throw CreateUnknownTypeException (ob);
  251. }
  252. if (writeWrappingElem) {
  253. WriteStartElement (element, namesp, ob);
  254. }
  255. if (needType) WriteXsiType("XmlSchemaRedefine", "http://www.w3.org/2001/XMLSchema");
  256. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  257. ICollection o8 = ob.@UnhandledAttributes;
  258. if (o8 != null) {
  259. foreach (XmlAttribute o9 in o8)
  260. if (o9.NamespaceURI != xmlNamespace)
  261. WriteXmlAttribute (o9, ob);
  262. }
  263. WriteAttribute ("schemaLocation", "", ob.@SchemaLocation);
  264. WriteAttribute ("id", "", ob.@Id);
  265. if (ob.@Items != null) {
  266. for (int n10 = 0; n10 < [email protected]; n10++) {
  267. if (ob.@Items[n10] == null) { }
  268. else if (ob.@Items[n10].GetType() == typeof(System.Xml.Schema.XmlSchemaGroup)) {
  269. WriteObject_XmlSchemaGroup (((System.Xml.Schema.XmlSchemaGroup) ob.@Items[n10]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  270. }
  271. else if (ob.@Items[n10].GetType() == typeof(System.Xml.Schema.XmlSchemaComplexType)) {
  272. WriteObject_XmlSchemaComplexType (((System.Xml.Schema.XmlSchemaComplexType) ob.@Items[n10]), "complexType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  273. }
  274. else if (ob.@Items[n10].GetType() == typeof(System.Xml.Schema.XmlSchemaSimpleType)) {
  275. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@Items[n10]), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  276. }
  277. else if (ob.@Items[n10].GetType() == typeof(System.Xml.Schema.XmlSchemaAnnotation)) {
  278. WriteObject_XmlSchemaAnnotation (((System.Xml.Schema.XmlSchemaAnnotation) ob.@Items[n10]), "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  279. }
  280. else if (ob.@Items[n10].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroup)) {
  281. WriteObject_XmlSchemaAttributeGroup (((System.Xml.Schema.XmlSchemaAttributeGroup) ob.@Items[n10]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  282. }
  283. else throw CreateUnknownTypeException (ob.@Items[n10]);
  284. }
  285. }
  286. if (writeWrappingElem) WriteEndElement (ob);
  287. }
  288. void WriteObject_XmlSchemaElement (System.Xml.Schema.XmlSchemaElement ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  289. {
  290. if (ob == null)
  291. {
  292. if (isNullable)
  293. WriteNullTagLiteral(element, namesp);
  294. return;
  295. }
  296. System.Type type = ob.GetType ();
  297. if (type == typeof(System.Xml.Schema.XmlSchemaElement))
  298. ;
  299. else {
  300. throw CreateUnknownTypeException (ob);
  301. }
  302. if (writeWrappingElem) {
  303. WriteStartElement (element, namesp, ob);
  304. }
  305. if (needType) WriteXsiType("XmlSchemaElement", "http://www.w3.org/2001/XMLSchema");
  306. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  307. ICollection o11 = ob.@UnhandledAttributes;
  308. if (o11 != null) {
  309. foreach (XmlAttribute o12 in o11)
  310. if (o12.NamespaceURI != xmlNamespace)
  311. WriteXmlAttribute (o12, ob);
  312. }
  313. WriteAttribute ("id", "", ob.@Id);
  314. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  315. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  316. if (ob.@IsAbstract != false) {
  317. WriteAttribute ("abstract", "", (ob.@IsAbstract?"true":"false"));
  318. }
  319. if (ob.@Block != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  320. WriteAttribute ("block", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Block));
  321. }
  322. if (ob.@DefaultValue != null) {
  323. WriteAttribute ("default", "", ob.@DefaultValue);
  324. }
  325. if (ob.@Final != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  326. WriteAttribute ("final", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Final));
  327. }
  328. if (ob.@FixedValue != null) {
  329. WriteAttribute ("fixed", "", ob.@FixedValue);
  330. }
  331. if (ob.@Form != ((System.Xml.Schema.XmlSchemaForm) System.Xml.Schema.XmlSchemaForm.None)) {
  332. WriteAttribute ("form", "", GetEnumValue_XmlSchemaForm (ob.@Form));
  333. }
  334. if (ob.@Name != null) {
  335. WriteAttribute ("name", "", ob.@Name);
  336. }
  337. if (ob.@IsNillable != false) {
  338. WriteAttribute ("nillable", "", (ob.@IsNillable?"true":"false"));
  339. }
  340. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  341. WriteAttribute ("substitutionGroup", "", FromXmlQualifiedName (ob.@SubstitutionGroup));
  342. WriteAttribute ("type", "", FromXmlQualifiedName (ob.@SchemaTypeName));
  343. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  344. if (ob.@SchemaType is System.Xml.Schema.XmlSchemaSimpleType) {
  345. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@SchemaType), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  346. }
  347. else if (ob.@SchemaType is System.Xml.Schema.XmlSchemaComplexType) {
  348. WriteObject_XmlSchemaComplexType (((System.Xml.Schema.XmlSchemaComplexType) ob.@SchemaType), "complexType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  349. }
  350. if (ob.@Constraints != null) {
  351. for (int n13 = 0; n13 < [email protected]; n13++) {
  352. if (ob.@Constraints[n13] == null) { }
  353. else if (ob.@Constraints[n13].GetType() == typeof(System.Xml.Schema.XmlSchemaKeyref)) {
  354. WriteObject_XmlSchemaKeyref (((System.Xml.Schema.XmlSchemaKeyref) ob.@Constraints[n13]), "keyref", "http://www.w3.org/2001/XMLSchema", false, false, true);
  355. }
  356. else if (ob.@Constraints[n13].GetType() == typeof(System.Xml.Schema.XmlSchemaKey)) {
  357. WriteObject_XmlSchemaKey (((System.Xml.Schema.XmlSchemaKey) ob.@Constraints[n13]), "key", "http://www.w3.org/2001/XMLSchema", false, false, true);
  358. }
  359. else if (ob.@Constraints[n13].GetType() == typeof(System.Xml.Schema.XmlSchemaUnique)) {
  360. WriteObject_XmlSchemaUnique (((System.Xml.Schema.XmlSchemaUnique) ob.@Constraints[n13]), "unique", "http://www.w3.org/2001/XMLSchema", false, false, true);
  361. }
  362. else throw CreateUnknownTypeException (ob.@Constraints[n13]);
  363. }
  364. }
  365. if (writeWrappingElem) WriteEndElement (ob);
  366. }
  367. void WriteObject_XmlSchemaSimpleType (System.Xml.Schema.XmlSchemaSimpleType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  368. {
  369. if (ob == null)
  370. {
  371. if (isNullable)
  372. WriteNullTagLiteral(element, namesp);
  373. return;
  374. }
  375. System.Type type = ob.GetType ();
  376. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleType))
  377. ;
  378. else {
  379. throw CreateUnknownTypeException (ob);
  380. }
  381. if (writeWrappingElem) {
  382. WriteStartElement (element, namesp, ob);
  383. }
  384. if (needType) WriteXsiType("XmlSchemaSimpleType", "http://www.w3.org/2001/XMLSchema");
  385. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  386. ICollection o14 = ob.@UnhandledAttributes;
  387. if (o14 != null) {
  388. foreach (XmlAttribute o15 in o14)
  389. if (o15.NamespaceURI != xmlNamespace)
  390. WriteXmlAttribute (o15, ob);
  391. }
  392. WriteAttribute ("id", "", ob.@Id);
  393. WriteAttribute ("name", "", ob.@Name);
  394. if (ob.@Final != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  395. WriteAttribute ("final", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Final));
  396. }
  397. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  398. if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleTypeUnion) {
  399. WriteObject_XmlSchemaSimpleTypeUnion (((System.Xml.Schema.XmlSchemaSimpleTypeUnion) ob.@Content), "union", "http://www.w3.org/2001/XMLSchema", false, false, true);
  400. }
  401. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleTypeList) {
  402. WriteObject_XmlSchemaSimpleTypeList (((System.Xml.Schema.XmlSchemaSimpleTypeList) ob.@Content), "list", "http://www.w3.org/2001/XMLSchema", false, false, true);
  403. }
  404. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleTypeRestriction) {
  405. WriteObject_XmlSchemaSimpleTypeRestriction (((System.Xml.Schema.XmlSchemaSimpleTypeRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  406. }
  407. if (writeWrappingElem) WriteEndElement (ob);
  408. }
  409. void WriteObject_XmlSchemaAttribute (System.Xml.Schema.XmlSchemaAttribute ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  410. {
  411. if (ob == null)
  412. {
  413. if (isNullable)
  414. WriteNullTagLiteral(element, namesp);
  415. return;
  416. }
  417. System.Type type = ob.GetType ();
  418. if (type == typeof(System.Xml.Schema.XmlSchemaAttribute))
  419. ;
  420. else {
  421. throw CreateUnknownTypeException (ob);
  422. }
  423. if (writeWrappingElem) {
  424. WriteStartElement (element, namesp, ob);
  425. }
  426. if (needType) WriteXsiType("XmlSchemaAttribute", "http://www.w3.org/2001/XMLSchema");
  427. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  428. ICollection o16 = ob.@UnhandledAttributes;
  429. if (o16 != null) {
  430. foreach (XmlAttribute o17 in o16)
  431. if (o17.NamespaceURI != xmlNamespace)
  432. WriteXmlAttribute (o17, ob);
  433. }
  434. WriteAttribute ("id", "", ob.@Id);
  435. if (ob.@DefaultValue != null) {
  436. WriteAttribute ("default", "", ob.@DefaultValue);
  437. }
  438. if (ob.@FixedValue != null) {
  439. WriteAttribute ("fixed", "", ob.@FixedValue);
  440. }
  441. if (ob.@Form != ((System.Xml.Schema.XmlSchemaForm) System.Xml.Schema.XmlSchemaForm.None)) {
  442. WriteAttribute ("form", "", GetEnumValue_XmlSchemaForm (ob.@Form));
  443. }
  444. WriteAttribute ("name", "", ob.@Name);
  445. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  446. WriteAttribute ("type", "", FromXmlQualifiedName (ob.@SchemaTypeName));
  447. if (ob.@Use != ((System.Xml.Schema.XmlSchemaUse) System.Xml.Schema.XmlSchemaUse.None)) {
  448. WriteAttribute ("use", "", GetEnumValue_XmlSchemaUse (ob.@Use));
  449. }
  450. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  451. WriteObject_XmlSchemaSimpleType (ob.@SchemaType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  452. if (writeWrappingElem) WriteEndElement (ob);
  453. }
  454. void WriteObject_XmlSchemaAnnotation (System.Xml.Schema.XmlSchemaAnnotation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  455. {
  456. if (ob == null)
  457. {
  458. if (isNullable)
  459. WriteNullTagLiteral(element, namesp);
  460. return;
  461. }
  462. System.Type type = ob.GetType ();
  463. if (type == typeof(System.Xml.Schema.XmlSchemaAnnotation))
  464. ;
  465. else {
  466. throw CreateUnknownTypeException (ob);
  467. }
  468. if (writeWrappingElem) {
  469. WriteStartElement (element, namesp, ob);
  470. }
  471. if (needType) WriteXsiType("XmlSchemaAnnotation", "http://www.w3.org/2001/XMLSchema");
  472. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  473. ICollection o18 = ob.@UnhandledAttributes;
  474. if (o18 != null) {
  475. foreach (XmlAttribute o19 in o18)
  476. if (o19.NamespaceURI != xmlNamespace)
  477. WriteXmlAttribute (o19, ob);
  478. }
  479. WriteAttribute ("id", "", ob.@Id);
  480. if (ob.@Items != null) {
  481. for (int n20 = 0; n20 < [email protected]; n20++) {
  482. if (ob.@Items[n20] == null) { }
  483. else if (ob.@Items[n20].GetType() == typeof(System.Xml.Schema.XmlSchemaAppInfo)) {
  484. WriteObject_XmlSchemaAppInfo (((System.Xml.Schema.XmlSchemaAppInfo) ob.@Items[n20]), "appinfo", "http://www.w3.org/2001/XMLSchema", false, false, true);
  485. }
  486. else if (ob.@Items[n20].GetType() == typeof(System.Xml.Schema.XmlSchemaDocumentation)) {
  487. WriteObject_XmlSchemaDocumentation (((System.Xml.Schema.XmlSchemaDocumentation) ob.@Items[n20]), "documentation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  488. }
  489. else throw CreateUnknownTypeException (ob.@Items[n20]);
  490. }
  491. }
  492. if (writeWrappingElem) WriteEndElement (ob);
  493. }
  494. void WriteObject_XmlSchemaAttributeGroup (System.Xml.Schema.XmlSchemaAttributeGroup ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  495. {
  496. if (ob == null)
  497. {
  498. if (isNullable)
  499. WriteNullTagLiteral(element, namesp);
  500. return;
  501. }
  502. System.Type type = ob.GetType ();
  503. if (type == typeof(System.Xml.Schema.XmlSchemaAttributeGroup))
  504. ;
  505. else {
  506. throw CreateUnknownTypeException (ob);
  507. }
  508. if (writeWrappingElem) {
  509. WriteStartElement (element, namesp, ob);
  510. }
  511. if (needType) WriteXsiType("XmlSchemaAttributeGroup", "http://www.w3.org/2001/XMLSchema");
  512. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  513. ICollection o21 = ob.@UnhandledAttributes;
  514. if (o21 != null) {
  515. foreach (XmlAttribute o22 in o21)
  516. if (o22.NamespaceURI != xmlNamespace)
  517. WriteXmlAttribute (o22, ob);
  518. }
  519. WriteAttribute ("id", "", ob.@Id);
  520. WriteAttribute ("name", "", ob.@Name);
  521. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  522. if (ob.@Attributes != null) {
  523. for (int n23 = 0; n23 < [email protected]; n23++) {
  524. if (ob.@Attributes[n23] == null) { }
  525. else if (ob.@Attributes[n23].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  526. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n23]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  527. }
  528. else if (ob.@Attributes[n23].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  529. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n23]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  530. }
  531. else throw CreateUnknownTypeException (ob.@Attributes[n23]);
  532. }
  533. }
  534. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  535. if (writeWrappingElem) WriteEndElement (ob);
  536. }
  537. void WriteObject_XmlSchemaGroup (System.Xml.Schema.XmlSchemaGroup ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  538. {
  539. if (ob == null)
  540. {
  541. if (isNullable)
  542. WriteNullTagLiteral(element, namesp);
  543. return;
  544. }
  545. System.Type type = ob.GetType ();
  546. if (type == typeof(System.Xml.Schema.XmlSchemaGroup))
  547. ;
  548. else {
  549. throw CreateUnknownTypeException (ob);
  550. }
  551. if (writeWrappingElem) {
  552. WriteStartElement (element, namesp, ob);
  553. }
  554. if (needType) WriteXsiType("XmlSchemaGroup", "http://www.w3.org/2001/XMLSchema");
  555. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  556. ICollection o24 = ob.@UnhandledAttributes;
  557. if (o24 != null) {
  558. foreach (XmlAttribute o25 in o24)
  559. if (o25.NamespaceURI != xmlNamespace)
  560. WriteXmlAttribute (o25, ob);
  561. }
  562. WriteAttribute ("id", "", ob.@Id);
  563. WriteAttribute ("name", "", ob.@Name);
  564. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  565. if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  566. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  567. }
  568. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  569. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  570. }
  571. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  572. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  573. }
  574. if (writeWrappingElem) WriteEndElement (ob);
  575. }
  576. void WriteObject_XmlSchemaComplexType (System.Xml.Schema.XmlSchemaComplexType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  577. {
  578. if (ob == null)
  579. {
  580. if (isNullable)
  581. WriteNullTagLiteral(element, namesp);
  582. return;
  583. }
  584. System.Type type = ob.GetType ();
  585. if (type == typeof(System.Xml.Schema.XmlSchemaComplexType))
  586. ;
  587. else {
  588. throw CreateUnknownTypeException (ob);
  589. }
  590. if (writeWrappingElem) {
  591. WriteStartElement (element, namesp, ob);
  592. }
  593. if (needType) WriteXsiType("XmlSchemaComplexType", "http://www.w3.org/2001/XMLSchema");
  594. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  595. ICollection o26 = ob.@UnhandledAttributes;
  596. if (o26 != null) {
  597. foreach (XmlAttribute o27 in o26)
  598. if (o27.NamespaceURI != xmlNamespace)
  599. WriteXmlAttribute (o27, ob);
  600. }
  601. WriteAttribute ("id", "", ob.@Id);
  602. WriteAttribute ("name", "", ob.@Name);
  603. if (ob.@Final != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  604. WriteAttribute ("final", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Final));
  605. }
  606. if (ob.@IsAbstract != false) {
  607. WriteAttribute ("abstract", "", (ob.@IsAbstract?"true":"false"));
  608. }
  609. if (ob.@Block != ((System.Xml.Schema.XmlSchemaDerivationMethod) System.Xml.Schema.XmlSchemaDerivationMethod.None)) {
  610. WriteAttribute ("block", "", GetEnumValue_XmlSchemaDerivationMethod (ob.@Block));
  611. }
  612. if (ob.@IsMixed != false) {
  613. WriteAttribute ("mixed", "", (ob.@IsMixed?"true":"false"));
  614. }
  615. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  616. if (ob.@ContentModel is System.Xml.Schema.XmlSchemaComplexContent) {
  617. WriteObject_XmlSchemaComplexContent (((System.Xml.Schema.XmlSchemaComplexContent) ob.@ContentModel), "complexContent", "http://www.w3.org/2001/XMLSchema", false, false, true);
  618. }
  619. else if (ob.@ContentModel is System.Xml.Schema.XmlSchemaSimpleContent) {
  620. WriteObject_XmlSchemaSimpleContent (((System.Xml.Schema.XmlSchemaSimpleContent) ob.@ContentModel), "simpleContent", "http://www.w3.org/2001/XMLSchema", false, false, true);
  621. }
  622. if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  623. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  624. }
  625. else if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  626. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  627. }
  628. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  629. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  630. }
  631. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  632. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  633. }
  634. if (ob.@Attributes != null) {
  635. for (int n28 = 0; n28 < [email protected]; n28++) {
  636. if (ob.@Attributes[n28] == null) { }
  637. else if (ob.@Attributes[n28].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  638. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n28]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  639. }
  640. else if (ob.@Attributes[n28].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  641. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n28]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  642. }
  643. else throw CreateUnknownTypeException (ob.@Attributes[n28]);
  644. }
  645. }
  646. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  647. if (writeWrappingElem) WriteEndElement (ob);
  648. }
  649. void WriteObject_XmlSchemaNotation (System.Xml.Schema.XmlSchemaNotation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  650. {
  651. if (ob == null)
  652. {
  653. if (isNullable)
  654. WriteNullTagLiteral(element, namesp);
  655. return;
  656. }
  657. System.Type type = ob.GetType ();
  658. if (type == typeof(System.Xml.Schema.XmlSchemaNotation))
  659. ;
  660. else {
  661. throw CreateUnknownTypeException (ob);
  662. }
  663. if (writeWrappingElem) {
  664. WriteStartElement (element, namesp, ob);
  665. }
  666. if (needType) WriteXsiType("XmlSchemaNotation", "http://www.w3.org/2001/XMLSchema");
  667. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  668. ICollection o29 = ob.@UnhandledAttributes;
  669. if (o29 != null) {
  670. foreach (XmlAttribute o30 in o29)
  671. if (o30.NamespaceURI != xmlNamespace)
  672. WriteXmlAttribute (o30, ob);
  673. }
  674. WriteAttribute ("id", "", ob.@Id);
  675. WriteAttribute ("name", "", ob.@Name);
  676. WriteAttribute ("public", "", ob.@Public);
  677. WriteAttribute ("system", "", ob.@System);
  678. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  679. if (writeWrappingElem) WriteEndElement (ob);
  680. }
  681. void WriteObject_XmlSchemaKeyref (System.Xml.Schema.XmlSchemaKeyref ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  682. {
  683. if (ob == null)
  684. {
  685. if (isNullable)
  686. WriteNullTagLiteral(element, namesp);
  687. return;
  688. }
  689. System.Type type = ob.GetType ();
  690. if (type == typeof(System.Xml.Schema.XmlSchemaKeyref))
  691. ;
  692. else {
  693. throw CreateUnknownTypeException (ob);
  694. }
  695. if (writeWrappingElem) {
  696. WriteStartElement (element, namesp, ob);
  697. }
  698. if (needType) WriteXsiType("XmlSchemaKeyref", "http://www.w3.org/2001/XMLSchema");
  699. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  700. ICollection o31 = ob.@UnhandledAttributes;
  701. if (o31 != null) {
  702. foreach (XmlAttribute o32 in o31)
  703. if (o32.NamespaceURI != xmlNamespace)
  704. WriteXmlAttribute (o32, ob);
  705. }
  706. WriteAttribute ("id", "", ob.@Id);
  707. WriteAttribute ("name", "", ob.@Name);
  708. WriteAttribute ("refer", "", FromXmlQualifiedName (ob.@Refer));
  709. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  710. WriteObject_XmlSchemaXPath (ob.@Selector, "selector", "http://www.w3.org/2001/XMLSchema", false, false, true);
  711. if (ob.@Fields != null) {
  712. for (int n33 = 0; n33 < [email protected]; n33++) {
  713. WriteObject_XmlSchemaXPath (((System.Xml.Schema.XmlSchemaXPath) ob.@Fields[n33]), "field", "http://www.w3.org/2001/XMLSchema", false, false, true);
  714. }
  715. }
  716. if (writeWrappingElem) WriteEndElement (ob);
  717. }
  718. void WriteObject_XmlSchemaKey (System.Xml.Schema.XmlSchemaKey ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  719. {
  720. if (ob == null)
  721. {
  722. if (isNullable)
  723. WriteNullTagLiteral(element, namesp);
  724. return;
  725. }
  726. System.Type type = ob.GetType ();
  727. if (type == typeof(System.Xml.Schema.XmlSchemaKey))
  728. ;
  729. else {
  730. throw CreateUnknownTypeException (ob);
  731. }
  732. if (writeWrappingElem) {
  733. WriteStartElement (element, namesp, ob);
  734. }
  735. if (needType) WriteXsiType("XmlSchemaKey", "http://www.w3.org/2001/XMLSchema");
  736. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  737. ICollection o34 = ob.@UnhandledAttributes;
  738. if (o34 != null) {
  739. foreach (XmlAttribute o35 in o34)
  740. if (o35.NamespaceURI != xmlNamespace)
  741. WriteXmlAttribute (o35, ob);
  742. }
  743. WriteAttribute ("id", "", ob.@Id);
  744. WriteAttribute ("name", "", ob.@Name);
  745. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  746. WriteObject_XmlSchemaXPath (ob.@Selector, "selector", "http://www.w3.org/2001/XMLSchema", false, false, true);
  747. if (ob.@Fields != null) {
  748. for (int n36 = 0; n36 < [email protected]; n36++) {
  749. WriteObject_XmlSchemaXPath (((System.Xml.Schema.XmlSchemaXPath) ob.@Fields[n36]), "field", "http://www.w3.org/2001/XMLSchema", false, false, true);
  750. }
  751. }
  752. if (writeWrappingElem) WriteEndElement (ob);
  753. }
  754. void WriteObject_XmlSchemaUnique (System.Xml.Schema.XmlSchemaUnique ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  755. {
  756. if (ob == null)
  757. {
  758. if (isNullable)
  759. WriteNullTagLiteral(element, namesp);
  760. return;
  761. }
  762. System.Type type = ob.GetType ();
  763. if (type == typeof(System.Xml.Schema.XmlSchemaUnique))
  764. ;
  765. else {
  766. throw CreateUnknownTypeException (ob);
  767. }
  768. if (writeWrappingElem) {
  769. WriteStartElement (element, namesp, ob);
  770. }
  771. if (needType) WriteXsiType("XmlSchemaUnique", "http://www.w3.org/2001/XMLSchema");
  772. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  773. ICollection o37 = ob.@UnhandledAttributes;
  774. if (o37 != null) {
  775. foreach (XmlAttribute o38 in o37)
  776. if (o38.NamespaceURI != xmlNamespace)
  777. WriteXmlAttribute (o38, ob);
  778. }
  779. WriteAttribute ("id", "", ob.@Id);
  780. WriteAttribute ("name", "", ob.@Name);
  781. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  782. WriteObject_XmlSchemaXPath (ob.@Selector, "selector", "http://www.w3.org/2001/XMLSchema", false, false, true);
  783. if (ob.@Fields != null) {
  784. for (int n39 = 0; n39 < [email protected]; n39++) {
  785. WriteObject_XmlSchemaXPath (((System.Xml.Schema.XmlSchemaXPath) ob.@Fields[n39]), "field", "http://www.w3.org/2001/XMLSchema", false, false, true);
  786. }
  787. }
  788. if (writeWrappingElem) WriteEndElement (ob);
  789. }
  790. void WriteObject_XmlSchemaSimpleTypeUnion (System.Xml.Schema.XmlSchemaSimpleTypeUnion ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  791. {
  792. if (ob == null)
  793. {
  794. if (isNullable)
  795. WriteNullTagLiteral(element, namesp);
  796. return;
  797. }
  798. System.Type type = ob.GetType ();
  799. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleTypeUnion))
  800. ;
  801. else {
  802. throw CreateUnknownTypeException (ob);
  803. }
  804. if (writeWrappingElem) {
  805. WriteStartElement (element, namesp, ob);
  806. }
  807. if (needType) WriteXsiType("XmlSchemaSimpleTypeUnion", "http://www.w3.org/2001/XMLSchema");
  808. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  809. ICollection o40 = ob.@UnhandledAttributes;
  810. if (o40 != null) {
  811. foreach (XmlAttribute o41 in o40)
  812. if (o41.NamespaceURI != xmlNamespace)
  813. WriteXmlAttribute (o41, ob);
  814. }
  815. WriteAttribute ("id", "", ob.@Id);
  816. string s42 = null;
  817. if (ob.@MemberTypes != null) {
  818. System.Text.StringBuilder s43 = new System.Text.StringBuilder();
  819. for (int n44 = 0; n44 < [email protected]; n44++) {
  820. s43.Append (FromXmlQualifiedName (ob.@MemberTypes[n44])).Append (" ");
  821. }
  822. s42 = s43.ToString ().Trim ();
  823. }
  824. WriteAttribute ("memberTypes", "", s42);
  825. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  826. if (ob.@BaseTypes != null) {
  827. for (int n45 = 0; n45 < [email protected]; n45++) {
  828. WriteObject_XmlSchemaSimpleType (((System.Xml.Schema.XmlSchemaSimpleType) ob.@BaseTypes[n45]), "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  829. }
  830. }
  831. if (writeWrappingElem) WriteEndElement (ob);
  832. }
  833. void WriteObject_XmlSchemaSimpleTypeList (System.Xml.Schema.XmlSchemaSimpleTypeList ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  834. {
  835. if (ob == null)
  836. {
  837. if (isNullable)
  838. WriteNullTagLiteral(element, namesp);
  839. return;
  840. }
  841. System.Type type = ob.GetType ();
  842. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleTypeList))
  843. ;
  844. else {
  845. throw CreateUnknownTypeException (ob);
  846. }
  847. if (writeWrappingElem) {
  848. WriteStartElement (element, namesp, ob);
  849. }
  850. if (needType) WriteXsiType("XmlSchemaSimpleTypeList", "http://www.w3.org/2001/XMLSchema");
  851. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  852. ICollection o46 = ob.@UnhandledAttributes;
  853. if (o46 != null) {
  854. foreach (XmlAttribute o47 in o46)
  855. if (o47.NamespaceURI != xmlNamespace)
  856. WriteXmlAttribute (o47, ob);
  857. }
  858. WriteAttribute ("id", "", ob.@Id);
  859. WriteAttribute ("itemType", "", FromXmlQualifiedName (ob.@ItemTypeName));
  860. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  861. WriteObject_XmlSchemaSimpleType (ob.@ItemType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  862. if (writeWrappingElem) WriteEndElement (ob);
  863. }
  864. void WriteObject_XmlSchemaSimpleTypeRestriction (System.Xml.Schema.XmlSchemaSimpleTypeRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  865. {
  866. if (ob == null)
  867. {
  868. if (isNullable)
  869. WriteNullTagLiteral(element, namesp);
  870. return;
  871. }
  872. System.Type type = ob.GetType ();
  873. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleTypeRestriction))
  874. ;
  875. else {
  876. throw CreateUnknownTypeException (ob);
  877. }
  878. if (writeWrappingElem) {
  879. WriteStartElement (element, namesp, ob);
  880. }
  881. if (needType) WriteXsiType("XmlSchemaSimpleTypeRestriction", "http://www.w3.org/2001/XMLSchema");
  882. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  883. ICollection o48 = ob.@UnhandledAttributes;
  884. if (o48 != null) {
  885. foreach (XmlAttribute o49 in o48)
  886. if (o49.NamespaceURI != xmlNamespace)
  887. WriteXmlAttribute (o49, ob);
  888. }
  889. WriteAttribute ("id", "", ob.@Id);
  890. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  891. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  892. WriteObject_XmlSchemaSimpleType (ob.@BaseType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  893. if (ob.@Facets != null) {
  894. for (int n50 = 0; n50 < [email protected]; n50++) {
  895. if (ob.@Facets[n50] == null) { }
  896. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet)) {
  897. WriteObject_XmlSchemaMaxLengthFacet (((System.Xml.Schema.XmlSchemaMaxLengthFacet) ob.@Facets[n50]), "maxLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  898. }
  899. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet)) {
  900. WriteObject_XmlSchemaMinLengthFacet (((System.Xml.Schema.XmlSchemaMinLengthFacet) ob.@Facets[n50]), "minLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  901. }
  902. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaLengthFacet)) {
  903. WriteObject_XmlSchemaLengthFacet (((System.Xml.Schema.XmlSchemaLengthFacet) ob.@Facets[n50]), "length", "http://www.w3.org/2001/XMLSchema", false, false, true);
  904. }
  905. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet)) {
  906. WriteObject_XmlSchemaFractionDigitsFacet (((System.Xml.Schema.XmlSchemaFractionDigitsFacet) ob.@Facets[n50]), "fractionDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  907. }
  908. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet)) {
  909. WriteObject_XmlSchemaMaxInclusiveFacet (((System.Xml.Schema.XmlSchemaMaxInclusiveFacet) ob.@Facets[n50]), "maxInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  910. }
  911. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet)) {
  912. WriteObject_XmlSchemaMaxExclusiveFacet (((System.Xml.Schema.XmlSchemaMaxExclusiveFacet) ob.@Facets[n50]), "maxExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  913. }
  914. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet)) {
  915. WriteObject_XmlSchemaMinExclusiveFacet (((System.Xml.Schema.XmlSchemaMinExclusiveFacet) ob.@Facets[n50]), "minExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  916. }
  917. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet)) {
  918. WriteObject_XmlSchemaEnumerationFacet (((System.Xml.Schema.XmlSchemaEnumerationFacet) ob.@Facets[n50]), "enumeration", "http://www.w3.org/2001/XMLSchema", false, false, true);
  919. }
  920. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet)) {
  921. WriteObject_XmlSchemaTotalDigitsFacet (((System.Xml.Schema.XmlSchemaTotalDigitsFacet) ob.@Facets[n50]), "totalDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  922. }
  923. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet)) {
  924. WriteObject_XmlSchemaMinInclusiveFacet (((System.Xml.Schema.XmlSchemaMinInclusiveFacet) ob.@Facets[n50]), "minInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  925. }
  926. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet)) {
  927. WriteObject_XmlSchemaWhiteSpaceFacet (((System.Xml.Schema.XmlSchemaWhiteSpaceFacet) ob.@Facets[n50]), "whiteSpace", "http://www.w3.org/2001/XMLSchema", false, false, true);
  928. }
  929. else if (ob.@Facets[n50].GetType() == typeof(System.Xml.Schema.XmlSchemaPatternFacet)) {
  930. WriteObject_XmlSchemaPatternFacet (((System.Xml.Schema.XmlSchemaPatternFacet) ob.@Facets[n50]), "pattern", "http://www.w3.org/2001/XMLSchema", false, false, true);
  931. }
  932. else throw CreateUnknownTypeException (ob.@Facets[n50]);
  933. }
  934. }
  935. if (writeWrappingElem) WriteEndElement (ob);
  936. }
  937. void WriteObject_XmlSchemaUse (System.Xml.Schema.XmlSchemaUse ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  938. {
  939. System.Type type = ob.GetType ();
  940. if (type == typeof(System.Xml.Schema.XmlSchemaUse))
  941. ;
  942. else {
  943. throw CreateUnknownTypeException (ob);
  944. }
  945. if (writeWrappingElem) {
  946. WriteStartElement (element, namesp, ob);
  947. }
  948. if (needType) WriteXsiType("XmlSchemaUse", "");
  949. Writer.WriteString (GetEnumValue_XmlSchemaUse (ob));
  950. if (writeWrappingElem) WriteEndElement (ob);
  951. }
  952. string GetEnumValue_XmlSchemaUse (System.Xml.Schema.XmlSchemaUse val)
  953. {
  954. switch (val)
  955. {
  956. case System.Xml.Schema.XmlSchemaUse.Optional: return "optional";
  957. case System.Xml.Schema.XmlSchemaUse.Prohibited: return "prohibited";
  958. case System.Xml.Schema.XmlSchemaUse.Required: return "required";
  959. default: return ((long)val).ToString(CultureInfo.InvariantCulture);
  960. }
  961. }
  962. void WriteObject_XmlSchemaAppInfo (System.Xml.Schema.XmlSchemaAppInfo ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  963. {
  964. if (ob == null)
  965. {
  966. if (isNullable)
  967. WriteNullTagLiteral(element, namesp);
  968. return;
  969. }
  970. System.Type type = ob.GetType ();
  971. if (type == typeof(System.Xml.Schema.XmlSchemaAppInfo))
  972. ;
  973. else {
  974. throw CreateUnknownTypeException (ob);
  975. }
  976. if (writeWrappingElem) {
  977. WriteStartElement (element, namesp, ob);
  978. }
  979. if (needType) WriteXsiType("XmlSchemaAppInfo", "http://www.w3.org/2001/XMLSchema");
  980. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  981. WriteAttribute ("source", "", ob.@Source);
  982. if (ob.@Markup != null) {
  983. foreach (XmlNode o51 in ob.@Markup) {
  984. XmlNode o52 = o51;
  985. if (o52 is XmlElement) {
  986. WriteElementLiteral (o52, "", "", false, true);
  987. } else o52.WriteTo (Writer);
  988. }
  989. }
  990. if (writeWrappingElem) WriteEndElement (ob);
  991. }
  992. void WriteObject_XmlSchemaDocumentation (System.Xml.Schema.XmlSchemaDocumentation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  993. {
  994. if (ob == null)
  995. {
  996. if (isNullable)
  997. WriteNullTagLiteral(element, namesp);
  998. return;
  999. }
  1000. System.Type type = ob.GetType ();
  1001. if (type == typeof(System.Xml.Schema.XmlSchemaDocumentation))
  1002. ;
  1003. else {
  1004. throw CreateUnknownTypeException (ob);
  1005. }
  1006. if (writeWrappingElem) {
  1007. WriteStartElement (element, namesp, ob);
  1008. }
  1009. if (needType) WriteXsiType("XmlSchemaDocumentation", "http://www.w3.org/2001/XMLSchema");
  1010. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1011. WriteAttribute ("source", "", ob.@Source);
  1012. WriteAttribute ("xml:lang", "", ob.@Language);
  1013. if (ob.@Markup != null) {
  1014. foreach (XmlNode o53 in ob.@Markup) {
  1015. XmlNode o54 = o53;
  1016. if (o54 is XmlElement) {
  1017. WriteElementLiteral (o54, "", "", false, true);
  1018. } else o54.WriteTo (Writer);
  1019. }
  1020. }
  1021. if (writeWrappingElem) WriteEndElement (ob);
  1022. }
  1023. void WriteObject_XmlSchemaAttributeGroupRef (System.Xml.Schema.XmlSchemaAttributeGroupRef ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1024. {
  1025. if (ob == null)
  1026. {
  1027. if (isNullable)
  1028. WriteNullTagLiteral(element, namesp);
  1029. return;
  1030. }
  1031. System.Type type = ob.GetType ();
  1032. if (type == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef))
  1033. ;
  1034. else {
  1035. throw CreateUnknownTypeException (ob);
  1036. }
  1037. if (writeWrappingElem) {
  1038. WriteStartElement (element, namesp, ob);
  1039. }
  1040. if (needType) WriteXsiType("XmlSchemaAttributeGroupRef", "http://www.w3.org/2001/XMLSchema");
  1041. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1042. ICollection o55 = ob.@UnhandledAttributes;
  1043. if (o55 != null) {
  1044. foreach (XmlAttribute o56 in o55)
  1045. if (o56.NamespaceURI != xmlNamespace)
  1046. WriteXmlAttribute (o56, ob);
  1047. }
  1048. WriteAttribute ("id", "", ob.@Id);
  1049. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  1050. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1051. if (writeWrappingElem) WriteEndElement (ob);
  1052. }
  1053. void WriteObject_XmlSchemaAnyAttribute (System.Xml.Schema.XmlSchemaAnyAttribute ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1054. {
  1055. if (ob == null)
  1056. {
  1057. if (isNullable)
  1058. WriteNullTagLiteral(element, namesp);
  1059. return;
  1060. }
  1061. System.Type type = ob.GetType ();
  1062. if (type == typeof(System.Xml.Schema.XmlSchemaAnyAttribute))
  1063. ;
  1064. else {
  1065. throw CreateUnknownTypeException (ob);
  1066. }
  1067. if (writeWrappingElem) {
  1068. WriteStartElement (element, namesp, ob);
  1069. }
  1070. if (needType) WriteXsiType("XmlSchemaAnyAttribute", "http://www.w3.org/2001/XMLSchema");
  1071. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1072. ICollection o57 = ob.@UnhandledAttributes;
  1073. if (o57 != null) {
  1074. foreach (XmlAttribute o58 in o57)
  1075. if (o58.NamespaceURI != xmlNamespace)
  1076. WriteXmlAttribute (o58, ob);
  1077. }
  1078. WriteAttribute ("id", "", ob.@Id);
  1079. WriteAttribute ("namespace", "", ob.@Namespace);
  1080. if (ob.@ProcessContents != ((System.Xml.Schema.XmlSchemaContentProcessing) System.Xml.Schema.XmlSchemaContentProcessing.None)) {
  1081. WriteAttribute ("processContents", "", GetEnumValue_XmlSchemaContentProcessing (ob.@ProcessContents));
  1082. }
  1083. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1084. if (writeWrappingElem) WriteEndElement (ob);
  1085. }
  1086. void WriteObject_XmlSchemaSequence (System.Xml.Schema.XmlSchemaSequence ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1087. {
  1088. if (ob == null)
  1089. {
  1090. if (isNullable)
  1091. WriteNullTagLiteral(element, namesp);
  1092. return;
  1093. }
  1094. System.Type type = ob.GetType ();
  1095. if (type == typeof(System.Xml.Schema.XmlSchemaSequence))
  1096. ;
  1097. else {
  1098. throw CreateUnknownTypeException (ob);
  1099. }
  1100. if (writeWrappingElem) {
  1101. WriteStartElement (element, namesp, ob);
  1102. }
  1103. if (needType) WriteXsiType("XmlSchemaSequence", "http://www.w3.org/2001/XMLSchema");
  1104. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1105. ICollection o59 = ob.@UnhandledAttributes;
  1106. if (o59 != null) {
  1107. foreach (XmlAttribute o60 in o59)
  1108. if (o60.NamespaceURI != xmlNamespace)
  1109. WriteXmlAttribute (o60, ob);
  1110. }
  1111. WriteAttribute ("id", "", ob.@Id);
  1112. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1113. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1114. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1115. if (ob.@Items != null) {
  1116. for (int n61 = 0; n61 < [email protected]; n61++) {
  1117. if (ob.@Items[n61] == null) { }
  1118. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaSequence)) {
  1119. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Items[n61]), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1120. }
  1121. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaChoice)) {
  1122. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Items[n61]), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1123. }
  1124. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaGroupRef)) {
  1125. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Items[n61]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1126. }
  1127. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  1128. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n61]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1129. }
  1130. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaAny)) {
  1131. WriteObject_XmlSchemaAny (((System.Xml.Schema.XmlSchemaAny) ob.@Items[n61]), "any", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1132. }
  1133. else throw CreateUnknownTypeException (ob.@Items[n61]);
  1134. }
  1135. }
  1136. if (writeWrappingElem) WriteEndElement (ob);
  1137. }
  1138. void WriteObject_XmlSchemaChoice (System.Xml.Schema.XmlSchemaChoice ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1139. {
  1140. if (ob == null)
  1141. {
  1142. if (isNullable)
  1143. WriteNullTagLiteral(element, namesp);
  1144. return;
  1145. }
  1146. System.Type type = ob.GetType ();
  1147. if (type == typeof(System.Xml.Schema.XmlSchemaChoice))
  1148. ;
  1149. else {
  1150. throw CreateUnknownTypeException (ob);
  1151. }
  1152. if (writeWrappingElem) {
  1153. WriteStartElement (element, namesp, ob);
  1154. }
  1155. if (needType) WriteXsiType("XmlSchemaChoice", "http://www.w3.org/2001/XMLSchema");
  1156. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1157. ICollection o62 = ob.@UnhandledAttributes;
  1158. if (o62 != null) {
  1159. foreach (XmlAttribute o63 in o62)
  1160. if (o63.NamespaceURI != xmlNamespace)
  1161. WriteXmlAttribute (o63, ob);
  1162. }
  1163. WriteAttribute ("id", "", ob.@Id);
  1164. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1165. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1166. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1167. if (ob.@Items != null) {
  1168. for (int n64 = 0; n64 < [email protected]; n64++) {
  1169. if (ob.@Items[n64] == null) { }
  1170. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaGroupRef)) {
  1171. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Items[n64]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1172. }
  1173. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  1174. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n64]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1175. }
  1176. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaAny)) {
  1177. WriteObject_XmlSchemaAny (((System.Xml.Schema.XmlSchemaAny) ob.@Items[n64]), "any", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1178. }
  1179. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaSequence)) {
  1180. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Items[n64]), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1181. }
  1182. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaChoice)) {
  1183. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Items[n64]), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1184. }
  1185. else throw CreateUnknownTypeException (ob.@Items[n64]);
  1186. }
  1187. }
  1188. if (writeWrappingElem) WriteEndElement (ob);
  1189. }
  1190. void WriteObject_XmlSchemaAll (System.Xml.Schema.XmlSchemaAll ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1191. {
  1192. if (ob == null)
  1193. {
  1194. if (isNullable)
  1195. WriteNullTagLiteral(element, namesp);
  1196. return;
  1197. }
  1198. System.Type type = ob.GetType ();
  1199. if (type == typeof(System.Xml.Schema.XmlSchemaAll))
  1200. ;
  1201. else {
  1202. throw CreateUnknownTypeException (ob);
  1203. }
  1204. if (writeWrappingElem) {
  1205. WriteStartElement (element, namesp, ob);
  1206. }
  1207. if (needType) WriteXsiType("XmlSchemaAll", "http://www.w3.org/2001/XMLSchema");
  1208. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1209. ICollection o65 = ob.@UnhandledAttributes;
  1210. if (o65 != null) {
  1211. foreach (XmlAttribute o66 in o65)
  1212. if (o66.NamespaceURI != xmlNamespace)
  1213. WriteXmlAttribute (o66, ob);
  1214. }
  1215. WriteAttribute ("id", "", ob.@Id);
  1216. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1217. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1218. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1219. if (ob.@Items != null) {
  1220. for (int n67 = 0; n67 < [email protected]; n67++) {
  1221. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n67]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1222. }
  1223. }
  1224. if (writeWrappingElem) WriteEndElement (ob);
  1225. }
  1226. void WriteObject_XmlSchemaComplexContent (System.Xml.Schema.XmlSchemaComplexContent ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1227. {
  1228. if (ob == null)
  1229. {
  1230. if (isNullable)
  1231. WriteNullTagLiteral(element, namesp);
  1232. return;
  1233. }
  1234. System.Type type = ob.GetType ();
  1235. if (type == typeof(System.Xml.Schema.XmlSchemaComplexContent))
  1236. ;
  1237. else {
  1238. throw CreateUnknownTypeException (ob);
  1239. }
  1240. if (writeWrappingElem) {
  1241. WriteStartElement (element, namesp, ob);
  1242. }
  1243. if (needType) WriteXsiType("XmlSchemaComplexContent", "http://www.w3.org/2001/XMLSchema");
  1244. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1245. ICollection o68 = ob.@UnhandledAttributes;
  1246. if (o68 != null) {
  1247. foreach (XmlAttribute o69 in o68)
  1248. if (o69.NamespaceURI != xmlNamespace)
  1249. WriteXmlAttribute (o69, ob);
  1250. }
  1251. WriteAttribute ("id", "", ob.@Id);
  1252. WriteAttribute ("mixed", "", (ob.@IsMixed?"true":"false"));
  1253. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1254. if (ob.@Content is System.Xml.Schema.XmlSchemaComplexContentExtension) {
  1255. WriteObject_XmlSchemaComplexContentExtension (((System.Xml.Schema.XmlSchemaComplexContentExtension) ob.@Content), "extension", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1256. }
  1257. else if (ob.@Content is System.Xml.Schema.XmlSchemaComplexContentRestriction) {
  1258. WriteObject_XmlSchemaComplexContentRestriction (((System.Xml.Schema.XmlSchemaComplexContentRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1259. }
  1260. if (writeWrappingElem) WriteEndElement (ob);
  1261. }
  1262. void WriteObject_XmlSchemaSimpleContent (System.Xml.Schema.XmlSchemaSimpleContent ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1263. {
  1264. if (ob == null)
  1265. {
  1266. if (isNullable)
  1267. WriteNullTagLiteral(element, namesp);
  1268. return;
  1269. }
  1270. System.Type type = ob.GetType ();
  1271. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleContent))
  1272. ;
  1273. else {
  1274. throw CreateUnknownTypeException (ob);
  1275. }
  1276. if (writeWrappingElem) {
  1277. WriteStartElement (element, namesp, ob);
  1278. }
  1279. if (needType) WriteXsiType("XmlSchemaSimpleContent", "http://www.w3.org/2001/XMLSchema");
  1280. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1281. ICollection o70 = ob.@UnhandledAttributes;
  1282. if (o70 != null) {
  1283. foreach (XmlAttribute o71 in o70)
  1284. if (o71.NamespaceURI != xmlNamespace)
  1285. WriteXmlAttribute (o71, ob);
  1286. }
  1287. WriteAttribute ("id", "", ob.@Id);
  1288. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1289. if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleContentExtension) {
  1290. WriteObject_XmlSchemaSimpleContentExtension (((System.Xml.Schema.XmlSchemaSimpleContentExtension) ob.@Content), "extension", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1291. }
  1292. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleContentRestriction) {
  1293. WriteObject_XmlSchemaSimpleContentRestriction (((System.Xml.Schema.XmlSchemaSimpleContentRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1294. }
  1295. if (writeWrappingElem) WriteEndElement (ob);
  1296. }
  1297. void WriteObject_XmlSchemaGroupRef (System.Xml.Schema.XmlSchemaGroupRef ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1298. {
  1299. if (ob == null)
  1300. {
  1301. if (isNullable)
  1302. WriteNullTagLiteral(element, namesp);
  1303. return;
  1304. }
  1305. System.Type type = ob.GetType ();
  1306. if (type == typeof(System.Xml.Schema.XmlSchemaGroupRef))
  1307. ;
  1308. else {
  1309. throw CreateUnknownTypeException (ob);
  1310. }
  1311. if (writeWrappingElem) {
  1312. WriteStartElement (element, namesp, ob);
  1313. }
  1314. if (needType) WriteXsiType("XmlSchemaGroupRef", "http://www.w3.org/2001/XMLSchema");
  1315. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1316. ICollection o72 = ob.@UnhandledAttributes;
  1317. if (o72 != null) {
  1318. foreach (XmlAttribute o73 in o72)
  1319. if (o73.NamespaceURI != xmlNamespace)
  1320. WriteXmlAttribute (o73, ob);
  1321. }
  1322. WriteAttribute ("id", "", ob.@Id);
  1323. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1324. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1325. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  1326. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1327. if (writeWrappingElem) WriteEndElement (ob);
  1328. }
  1329. void WriteObject_XmlSchemaXPath (System.Xml.Schema.XmlSchemaXPath ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1330. {
  1331. if (ob == null)
  1332. {
  1333. if (isNullable)
  1334. WriteNullTagLiteral(element, namesp);
  1335. return;
  1336. }
  1337. System.Type type = ob.GetType ();
  1338. if (type == typeof(System.Xml.Schema.XmlSchemaXPath))
  1339. ;
  1340. else {
  1341. throw CreateUnknownTypeException (ob);
  1342. }
  1343. if (writeWrappingElem) {
  1344. WriteStartElement (element, namesp, ob);
  1345. }
  1346. if (needType) WriteXsiType("XmlSchemaXPath", "http://www.w3.org/2001/XMLSchema");
  1347. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1348. ICollection o74 = ob.@UnhandledAttributes;
  1349. if (o74 != null) {
  1350. foreach (XmlAttribute o75 in o74)
  1351. if (o75.NamespaceURI != xmlNamespace)
  1352. WriteXmlAttribute (o75, ob);
  1353. }
  1354. WriteAttribute ("id", "", ob.@Id);
  1355. if (ob.@XPath != null) {
  1356. WriteAttribute ("xpath", "", ob.@XPath);
  1357. }
  1358. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1359. if (writeWrappingElem) WriteEndElement (ob);
  1360. }
  1361. void WriteObject_XmlSchemaMaxLengthFacet (System.Xml.Schema.XmlSchemaMaxLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1362. {
  1363. if (ob == null)
  1364. {
  1365. if (isNullable)
  1366. WriteNullTagLiteral(element, namesp);
  1367. return;
  1368. }
  1369. System.Type type = ob.GetType ();
  1370. if (type == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet))
  1371. ;
  1372. else {
  1373. throw CreateUnknownTypeException (ob);
  1374. }
  1375. if (writeWrappingElem) {
  1376. WriteStartElement (element, namesp, ob);
  1377. }
  1378. if (needType) WriteXsiType("XmlSchemaMaxLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1379. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1380. ICollection o76 = ob.@UnhandledAttributes;
  1381. if (o76 != null) {
  1382. foreach (XmlAttribute o77 in o76)
  1383. if (o77.NamespaceURI != xmlNamespace)
  1384. WriteXmlAttribute (o77, ob);
  1385. }
  1386. WriteAttribute ("id", "", ob.@Id);
  1387. WriteAttribute ("value", "", ob.@Value);
  1388. if (ob.@IsFixed != false) {
  1389. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1390. }
  1391. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1392. if (writeWrappingElem) WriteEndElement (ob);
  1393. }
  1394. void WriteObject_XmlSchemaMinLengthFacet (System.Xml.Schema.XmlSchemaMinLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1395. {
  1396. if (ob == null)
  1397. {
  1398. if (isNullable)
  1399. WriteNullTagLiteral(element, namesp);
  1400. return;
  1401. }
  1402. System.Type type = ob.GetType ();
  1403. if (type == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet))
  1404. ;
  1405. else {
  1406. throw CreateUnknownTypeException (ob);
  1407. }
  1408. if (writeWrappingElem) {
  1409. WriteStartElement (element, namesp, ob);
  1410. }
  1411. if (needType) WriteXsiType("XmlSchemaMinLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1412. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1413. ICollection o78 = ob.@UnhandledAttributes;
  1414. if (o78 != null) {
  1415. foreach (XmlAttribute o79 in o78)
  1416. if (o79.NamespaceURI != xmlNamespace)
  1417. WriteXmlAttribute (o79, ob);
  1418. }
  1419. WriteAttribute ("id", "", ob.@Id);
  1420. WriteAttribute ("value", "", ob.@Value);
  1421. if (ob.@IsFixed != false) {
  1422. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1423. }
  1424. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1425. if (writeWrappingElem) WriteEndElement (ob);
  1426. }
  1427. void WriteObject_XmlSchemaLengthFacet (System.Xml.Schema.XmlSchemaLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1428. {
  1429. if (ob == null)
  1430. {
  1431. if (isNullable)
  1432. WriteNullTagLiteral(element, namesp);
  1433. return;
  1434. }
  1435. System.Type type = ob.GetType ();
  1436. if (type == typeof(System.Xml.Schema.XmlSchemaLengthFacet))
  1437. ;
  1438. else {
  1439. throw CreateUnknownTypeException (ob);
  1440. }
  1441. if (writeWrappingElem) {
  1442. WriteStartElement (element, namesp, ob);
  1443. }
  1444. if (needType) WriteXsiType("XmlSchemaLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1445. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1446. ICollection o80 = ob.@UnhandledAttributes;
  1447. if (o80 != null) {
  1448. foreach (XmlAttribute o81 in o80)
  1449. if (o81.NamespaceURI != xmlNamespace)
  1450. WriteXmlAttribute (o81, ob);
  1451. }
  1452. WriteAttribute ("id", "", ob.@Id);
  1453. WriteAttribute ("value", "", ob.@Value);
  1454. if (ob.@IsFixed != false) {
  1455. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1456. }
  1457. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1458. if (writeWrappingElem) WriteEndElement (ob);
  1459. }
  1460. void WriteObject_XmlSchemaFractionDigitsFacet (System.Xml.Schema.XmlSchemaFractionDigitsFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1461. {
  1462. if (ob == null)
  1463. {
  1464. if (isNullable)
  1465. WriteNullTagLiteral(element, namesp);
  1466. return;
  1467. }
  1468. System.Type type = ob.GetType ();
  1469. if (type == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet))
  1470. ;
  1471. else {
  1472. throw CreateUnknownTypeException (ob);
  1473. }
  1474. if (writeWrappingElem) {
  1475. WriteStartElement (element, namesp, ob);
  1476. }
  1477. if (needType) WriteXsiType("XmlSchemaFractionDigitsFacet", "http://www.w3.org/2001/XMLSchema");
  1478. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1479. ICollection o82 = ob.@UnhandledAttributes;
  1480. if (o82 != null) {
  1481. foreach (XmlAttribute o83 in o82)
  1482. if (o83.NamespaceURI != xmlNamespace)
  1483. WriteXmlAttribute (o83, ob);
  1484. }
  1485. WriteAttribute ("id", "", ob.@Id);
  1486. WriteAttribute ("value", "", ob.@Value);
  1487. if (ob.@IsFixed != false) {
  1488. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1489. }
  1490. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1491. if (writeWrappingElem) WriteEndElement (ob);
  1492. }
  1493. void WriteObject_XmlSchemaMaxInclusiveFacet (System.Xml.Schema.XmlSchemaMaxInclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1494. {
  1495. if (ob == null)
  1496. {
  1497. if (isNullable)
  1498. WriteNullTagLiteral(element, namesp);
  1499. return;
  1500. }
  1501. System.Type type = ob.GetType ();
  1502. if (type == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet))
  1503. ;
  1504. else {
  1505. throw CreateUnknownTypeException (ob);
  1506. }
  1507. if (writeWrappingElem) {
  1508. WriteStartElement (element, namesp, ob);
  1509. }
  1510. if (needType) WriteXsiType("XmlSchemaMaxInclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1511. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1512. ICollection o84 = ob.@UnhandledAttributes;
  1513. if (o84 != null) {
  1514. foreach (XmlAttribute o85 in o84)
  1515. if (o85.NamespaceURI != xmlNamespace)
  1516. WriteXmlAttribute (o85, ob);
  1517. }
  1518. WriteAttribute ("id", "", ob.@Id);
  1519. WriteAttribute ("value", "", ob.@Value);
  1520. if (ob.@IsFixed != false) {
  1521. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1522. }
  1523. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1524. if (writeWrappingElem) WriteEndElement (ob);
  1525. }
  1526. void WriteObject_XmlSchemaMaxExclusiveFacet (System.Xml.Schema.XmlSchemaMaxExclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1527. {
  1528. if (ob == null)
  1529. {
  1530. if (isNullable)
  1531. WriteNullTagLiteral(element, namesp);
  1532. return;
  1533. }
  1534. System.Type type = ob.GetType ();
  1535. if (type == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet))
  1536. ;
  1537. else {
  1538. throw CreateUnknownTypeException (ob);
  1539. }
  1540. if (writeWrappingElem) {
  1541. WriteStartElement (element, namesp, ob);
  1542. }
  1543. if (needType) WriteXsiType("XmlSchemaMaxExclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1544. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1545. ICollection o86 = ob.@UnhandledAttributes;
  1546. if (o86 != null) {
  1547. foreach (XmlAttribute o87 in o86)
  1548. if (o87.NamespaceURI != xmlNamespace)
  1549. WriteXmlAttribute (o87, ob);
  1550. }
  1551. WriteAttribute ("id", "", ob.@Id);
  1552. WriteAttribute ("value", "", ob.@Value);
  1553. if (ob.@IsFixed != false) {
  1554. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1555. }
  1556. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1557. if (writeWrappingElem) WriteEndElement (ob);
  1558. }
  1559. void WriteObject_XmlSchemaMinExclusiveFacet (System.Xml.Schema.XmlSchemaMinExclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1560. {
  1561. if (ob == null)
  1562. {
  1563. if (isNullable)
  1564. WriteNullTagLiteral(element, namesp);
  1565. return;
  1566. }
  1567. System.Type type = ob.GetType ();
  1568. if (type == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet))
  1569. ;
  1570. else {
  1571. throw CreateUnknownTypeException (ob);
  1572. }
  1573. if (writeWrappingElem) {
  1574. WriteStartElement (element, namesp, ob);
  1575. }
  1576. if (needType) WriteXsiType("XmlSchemaMinExclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1577. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1578. ICollection o88 = ob.@UnhandledAttributes;
  1579. if (o88 != null) {
  1580. foreach (XmlAttribute o89 in o88)
  1581. if (o89.NamespaceURI != xmlNamespace)
  1582. WriteXmlAttribute (o89, ob);
  1583. }
  1584. WriteAttribute ("id", "", ob.@Id);
  1585. WriteAttribute ("value", "", ob.@Value);
  1586. if (ob.@IsFixed != false) {
  1587. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1588. }
  1589. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1590. if (writeWrappingElem) WriteEndElement (ob);
  1591. }
  1592. void WriteObject_XmlSchemaEnumerationFacet (System.Xml.Schema.XmlSchemaEnumerationFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1593. {
  1594. if (ob == null)
  1595. {
  1596. if (isNullable)
  1597. WriteNullTagLiteral(element, namesp);
  1598. return;
  1599. }
  1600. System.Type type = ob.GetType ();
  1601. if (type == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet))
  1602. ;
  1603. else {
  1604. throw CreateUnknownTypeException (ob);
  1605. }
  1606. if (writeWrappingElem) {
  1607. WriteStartElement (element, namesp, ob);
  1608. }
  1609. if (needType) WriteXsiType("XmlSchemaEnumerationFacet", "http://www.w3.org/2001/XMLSchema");
  1610. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1611. ICollection o90 = ob.@UnhandledAttributes;
  1612. if (o90 != null) {
  1613. foreach (XmlAttribute o91 in o90)
  1614. if (o91.NamespaceURI != xmlNamespace)
  1615. WriteXmlAttribute (o91, ob);
  1616. }
  1617. WriteAttribute ("id", "", ob.@Id);
  1618. WriteAttribute ("value", "", ob.@Value);
  1619. if (ob.@IsFixed != false) {
  1620. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1621. }
  1622. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1623. if (writeWrappingElem) WriteEndElement (ob);
  1624. }
  1625. void WriteObject_XmlSchemaTotalDigitsFacet (System.Xml.Schema.XmlSchemaTotalDigitsFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1626. {
  1627. if (ob == null)
  1628. {
  1629. if (isNullable)
  1630. WriteNullTagLiteral(element, namesp);
  1631. return;
  1632. }
  1633. System.Type type = ob.GetType ();
  1634. if (type == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet))
  1635. ;
  1636. else {
  1637. throw CreateUnknownTypeException (ob);
  1638. }
  1639. if (writeWrappingElem) {
  1640. WriteStartElement (element, namesp, ob);
  1641. }
  1642. if (needType) WriteXsiType("XmlSchemaTotalDigitsFacet", "http://www.w3.org/2001/XMLSchema");
  1643. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1644. ICollection o92 = ob.@UnhandledAttributes;
  1645. if (o92 != null) {
  1646. foreach (XmlAttribute o93 in o92)
  1647. if (o93.NamespaceURI != xmlNamespace)
  1648. WriteXmlAttribute (o93, ob);
  1649. }
  1650. WriteAttribute ("id", "", ob.@Id);
  1651. WriteAttribute ("value", "", ob.@Value);
  1652. if (ob.@IsFixed != false) {
  1653. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1654. }
  1655. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1656. if (writeWrappingElem) WriteEndElement (ob);
  1657. }
  1658. void WriteObject_XmlSchemaMinInclusiveFacet (System.Xml.Schema.XmlSchemaMinInclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1659. {
  1660. if (ob == null)
  1661. {
  1662. if (isNullable)
  1663. WriteNullTagLiteral(element, namesp);
  1664. return;
  1665. }
  1666. System.Type type = ob.GetType ();
  1667. if (type == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet))
  1668. ;
  1669. else {
  1670. throw CreateUnknownTypeException (ob);
  1671. }
  1672. if (writeWrappingElem) {
  1673. WriteStartElement (element, namesp, ob);
  1674. }
  1675. if (needType) WriteXsiType("XmlSchemaMinInclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1676. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1677. ICollection o94 = ob.@UnhandledAttributes;
  1678. if (o94 != null) {
  1679. foreach (XmlAttribute o95 in o94)
  1680. if (o95.NamespaceURI != xmlNamespace)
  1681. WriteXmlAttribute (o95, ob);
  1682. }
  1683. WriteAttribute ("id", "", ob.@Id);
  1684. WriteAttribute ("value", "", ob.@Value);
  1685. if (ob.@IsFixed != false) {
  1686. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1687. }
  1688. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1689. if (writeWrappingElem) WriteEndElement (ob);
  1690. }
  1691. void WriteObject_XmlSchemaWhiteSpaceFacet (System.Xml.Schema.XmlSchemaWhiteSpaceFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1692. {
  1693. if (ob == null)
  1694. {
  1695. if (isNullable)
  1696. WriteNullTagLiteral(element, namesp);
  1697. return;
  1698. }
  1699. System.Type type = ob.GetType ();
  1700. if (type == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet))
  1701. ;
  1702. else {
  1703. throw CreateUnknownTypeException (ob);
  1704. }
  1705. if (writeWrappingElem) {
  1706. WriteStartElement (element, namesp, ob);
  1707. }
  1708. if (needType) WriteXsiType("XmlSchemaWhiteSpaceFacet", "http://www.w3.org/2001/XMLSchema");
  1709. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1710. ICollection o96 = ob.@UnhandledAttributes;
  1711. if (o96 != null) {
  1712. foreach (XmlAttribute o97 in o96)
  1713. if (o97.NamespaceURI != xmlNamespace)
  1714. WriteXmlAttribute (o97, ob);
  1715. }
  1716. WriteAttribute ("id", "", ob.@Id);
  1717. WriteAttribute ("value", "", ob.@Value);
  1718. if (ob.@IsFixed != false) {
  1719. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1720. }
  1721. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1722. if (writeWrappingElem) WriteEndElement (ob);
  1723. }
  1724. void WriteObject_XmlSchemaPatternFacet (System.Xml.Schema.XmlSchemaPatternFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1725. {
  1726. if (ob == null)
  1727. {
  1728. if (isNullable)
  1729. WriteNullTagLiteral(element, namesp);
  1730. return;
  1731. }
  1732. System.Type type = ob.GetType ();
  1733. if (type == typeof(System.Xml.Schema.XmlSchemaPatternFacet))
  1734. ;
  1735. else {
  1736. throw CreateUnknownTypeException (ob);
  1737. }
  1738. if (writeWrappingElem) {
  1739. WriteStartElement (element, namesp, ob);
  1740. }
  1741. if (needType) WriteXsiType("XmlSchemaPatternFacet", "http://www.w3.org/2001/XMLSchema");
  1742. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1743. ICollection o98 = ob.@UnhandledAttributes;
  1744. if (o98 != null) {
  1745. foreach (XmlAttribute o99 in o98)
  1746. if (o99.NamespaceURI != xmlNamespace)
  1747. WriteXmlAttribute (o99, ob);
  1748. }
  1749. WriteAttribute ("id", "", ob.@Id);
  1750. WriteAttribute ("value", "", ob.@Value);
  1751. if (ob.@IsFixed != false) {
  1752. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1753. }
  1754. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1755. if (writeWrappingElem) WriteEndElement (ob);
  1756. }
  1757. void WriteObject_XmlSchemaContentProcessing (System.Xml.Schema.XmlSchemaContentProcessing ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1758. {
  1759. System.Type type = ob.GetType ();
  1760. if (type == typeof(System.Xml.Schema.XmlSchemaContentProcessing))
  1761. ;
  1762. else {
  1763. throw CreateUnknownTypeException (ob);
  1764. }
  1765. if (writeWrappingElem) {
  1766. WriteStartElement (element, namesp, ob);
  1767. }
  1768. if (needType) WriteXsiType("XmlSchemaContentProcessing", "");
  1769. Writer.WriteString (GetEnumValue_XmlSchemaContentProcessing (ob));
  1770. if (writeWrappingElem) WriteEndElement (ob);
  1771. }
  1772. string GetEnumValue_XmlSchemaContentProcessing (System.Xml.Schema.XmlSchemaContentProcessing val)
  1773. {
  1774. switch (val)
  1775. {
  1776. case System.Xml.Schema.XmlSchemaContentProcessing.Skip: return "skip";
  1777. case System.Xml.Schema.XmlSchemaContentProcessing.Lax: return "lax";
  1778. case System.Xml.Schema.XmlSchemaContentProcessing.Strict: return "strict";
  1779. default: return ((long)val).ToString(CultureInfo.InvariantCulture);
  1780. }
  1781. }
  1782. void WriteObject_XmlSchemaAny (System.Xml.Schema.XmlSchemaAny ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1783. {
  1784. if (ob == null)
  1785. {
  1786. if (isNullable)
  1787. WriteNullTagLiteral(element, namesp);
  1788. return;
  1789. }
  1790. System.Type type = ob.GetType ();
  1791. if (type == typeof(System.Xml.Schema.XmlSchemaAny))
  1792. ;
  1793. else {
  1794. throw CreateUnknownTypeException (ob);
  1795. }
  1796. if (writeWrappingElem) {
  1797. WriteStartElement (element, namesp, ob);
  1798. }
  1799. if (needType) WriteXsiType("XmlSchemaAny", "http://www.w3.org/2001/XMLSchema");
  1800. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1801. ICollection o100 = ob.@UnhandledAttributes;
  1802. if (o100 != null) {
  1803. foreach (XmlAttribute o101 in o100)
  1804. if (o101.NamespaceURI != xmlNamespace)
  1805. WriteXmlAttribute (o101, ob);
  1806. }
  1807. WriteAttribute ("id", "", ob.@Id);
  1808. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1809. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1810. WriteAttribute ("namespace", "", ob.@Namespace);
  1811. if (ob.@ProcessContents != ((System.Xml.Schema.XmlSchemaContentProcessing) System.Xml.Schema.XmlSchemaContentProcessing.None)) {
  1812. WriteAttribute ("processContents", "", GetEnumValue_XmlSchemaContentProcessing (ob.@ProcessContents));
  1813. }
  1814. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1815. if (writeWrappingElem) WriteEndElement (ob);
  1816. }
  1817. void WriteObject_XmlSchemaComplexContentExtension (System.Xml.Schema.XmlSchemaComplexContentExtension ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1818. {
  1819. if (ob == null)
  1820. {
  1821. if (isNullable)
  1822. WriteNullTagLiteral(element, namesp);
  1823. return;
  1824. }
  1825. System.Type type = ob.GetType ();
  1826. if (type == typeof(System.Xml.Schema.XmlSchemaComplexContentExtension))
  1827. ;
  1828. else {
  1829. throw CreateUnknownTypeException (ob);
  1830. }
  1831. if (writeWrappingElem) {
  1832. WriteStartElement (element, namesp, ob);
  1833. }
  1834. if (needType) WriteXsiType("XmlSchemaComplexContentExtension", "http://www.w3.org/2001/XMLSchema");
  1835. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1836. ICollection o102 = ob.@UnhandledAttributes;
  1837. if (o102 != null) {
  1838. foreach (XmlAttribute o103 in o102)
  1839. if (o103.NamespaceURI != xmlNamespace)
  1840. WriteXmlAttribute (o103, ob);
  1841. }
  1842. WriteAttribute ("id", "", ob.@Id);
  1843. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1844. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1845. if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  1846. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1847. }
  1848. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  1849. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1850. }
  1851. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  1852. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1853. }
  1854. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  1855. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1856. }
  1857. if (ob.@Attributes != null) {
  1858. for (int n104 = 0; n104 < [email protected]; n104++) {
  1859. if (ob.@Attributes[n104] == null) { }
  1860. else if (ob.@Attributes[n104].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1861. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n104]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1862. }
  1863. else if (ob.@Attributes[n104].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1864. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n104]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1865. }
  1866. else throw CreateUnknownTypeException (ob.@Attributes[n104]);
  1867. }
  1868. }
  1869. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1870. if (writeWrappingElem) WriteEndElement (ob);
  1871. }
  1872. void WriteObject_XmlSchemaComplexContentRestriction (System.Xml.Schema.XmlSchemaComplexContentRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1873. {
  1874. if (ob == null)
  1875. {
  1876. if (isNullable)
  1877. WriteNullTagLiteral(element, namesp);
  1878. return;
  1879. }
  1880. System.Type type = ob.GetType ();
  1881. if (type == typeof(System.Xml.Schema.XmlSchemaComplexContentRestriction))
  1882. ;
  1883. else {
  1884. throw CreateUnknownTypeException (ob);
  1885. }
  1886. if (writeWrappingElem) {
  1887. WriteStartElement (element, namesp, ob);
  1888. }
  1889. if (needType) WriteXsiType("XmlSchemaComplexContentRestriction", "http://www.w3.org/2001/XMLSchema");
  1890. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1891. ICollection o105 = ob.@UnhandledAttributes;
  1892. if (o105 != null) {
  1893. foreach (XmlAttribute o106 in o105)
  1894. if (o106.NamespaceURI != xmlNamespace)
  1895. WriteXmlAttribute (o106, ob);
  1896. }
  1897. WriteAttribute ("id", "", ob.@Id);
  1898. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1899. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1900. if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  1901. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1902. }
  1903. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  1904. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1905. }
  1906. else if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  1907. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1908. }
  1909. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  1910. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1911. }
  1912. if (ob.@Attributes != null) {
  1913. for (int n107 = 0; n107 < [email protected]; n107++) {
  1914. if (ob.@Attributes[n107] == null) { }
  1915. else if (ob.@Attributes[n107].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1916. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n107]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1917. }
  1918. else if (ob.@Attributes[n107].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1919. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n107]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1920. }
  1921. else throw CreateUnknownTypeException (ob.@Attributes[n107]);
  1922. }
  1923. }
  1924. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1925. if (writeWrappingElem) WriteEndElement (ob);
  1926. }
  1927. void WriteObject_XmlSchemaSimpleContentExtension (System.Xml.Schema.XmlSchemaSimpleContentExtension ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1928. {
  1929. if (ob == null)
  1930. {
  1931. if (isNullable)
  1932. WriteNullTagLiteral(element, namesp);
  1933. return;
  1934. }
  1935. System.Type type = ob.GetType ();
  1936. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleContentExtension))
  1937. ;
  1938. else {
  1939. throw CreateUnknownTypeException (ob);
  1940. }
  1941. if (writeWrappingElem) {
  1942. WriteStartElement (element, namesp, ob);
  1943. }
  1944. if (needType) WriteXsiType("XmlSchemaSimpleContentExtension", "http://www.w3.org/2001/XMLSchema");
  1945. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1946. ICollection o108 = ob.@UnhandledAttributes;
  1947. if (o108 != null) {
  1948. foreach (XmlAttribute o109 in o108)
  1949. if (o109.NamespaceURI != xmlNamespace)
  1950. WriteXmlAttribute (o109, ob);
  1951. }
  1952. WriteAttribute ("id", "", ob.@Id);
  1953. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1954. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1955. if (ob.@Attributes != null) {
  1956. for (int n110 = 0; n110 < [email protected]; n110++) {
  1957. if (ob.@Attributes[n110] == null) { }
  1958. else if (ob.@Attributes[n110].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1959. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n110]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1960. }
  1961. else if (ob.@Attributes[n110].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1962. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n110]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1963. }
  1964. else throw CreateUnknownTypeException (ob.@Attributes[n110]);
  1965. }
  1966. }
  1967. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1968. if (writeWrappingElem) WriteEndElement (ob);
  1969. }
  1970. void WriteObject_XmlSchemaSimpleContentRestriction (System.Xml.Schema.XmlSchemaSimpleContentRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1971. {
  1972. if (ob == null)
  1973. {
  1974. if (isNullable)
  1975. WriteNullTagLiteral(element, namesp);
  1976. return;
  1977. }
  1978. System.Type type = ob.GetType ();
  1979. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleContentRestriction))
  1980. ;
  1981. else {
  1982. throw CreateUnknownTypeException (ob);
  1983. }
  1984. if (writeWrappingElem) {
  1985. WriteStartElement (element, namesp, ob);
  1986. }
  1987. if (needType) WriteXsiType("XmlSchemaSimpleContentRestriction", "http://www.w3.org/2001/XMLSchema");
  1988. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1989. ICollection o111 = ob.@UnhandledAttributes;
  1990. if (o111 != null) {
  1991. foreach (XmlAttribute o112 in o111)
  1992. if (o112.NamespaceURI != xmlNamespace)
  1993. WriteXmlAttribute (o112, ob);
  1994. }
  1995. WriteAttribute ("id", "", ob.@Id);
  1996. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1997. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1998. WriteObject_XmlSchemaSimpleType (ob.@BaseType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1999. if (ob.@Facets != null) {
  2000. for (int n113 = 0; n113 < [email protected]; n113++) {
  2001. if (ob.@Facets[n113] == null) { }
  2002. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet)) {
  2003. WriteObject_XmlSchemaEnumerationFacet (((System.Xml.Schema.XmlSchemaEnumerationFacet) ob.@Facets[n113]), "enumeration", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2004. }
  2005. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet)) {
  2006. WriteObject_XmlSchemaMaxLengthFacet (((System.Xml.Schema.XmlSchemaMaxLengthFacet) ob.@Facets[n113]), "maxLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2007. }
  2008. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet)) {
  2009. WriteObject_XmlSchemaMinLengthFacet (((System.Xml.Schema.XmlSchemaMinLengthFacet) ob.@Facets[n113]), "minLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2010. }
  2011. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaLengthFacet)) {
  2012. WriteObject_XmlSchemaLengthFacet (((System.Xml.Schema.XmlSchemaLengthFacet) ob.@Facets[n113]), "length", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2013. }
  2014. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet)) {
  2015. WriteObject_XmlSchemaFractionDigitsFacet (((System.Xml.Schema.XmlSchemaFractionDigitsFacet) ob.@Facets[n113]), "fractionDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2016. }
  2017. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet)) {
  2018. WriteObject_XmlSchemaTotalDigitsFacet (((System.Xml.Schema.XmlSchemaTotalDigitsFacet) ob.@Facets[n113]), "totalDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2019. }
  2020. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet)) {
  2021. WriteObject_XmlSchemaMaxInclusiveFacet (((System.Xml.Schema.XmlSchemaMaxInclusiveFacet) ob.@Facets[n113]), "maxInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2022. }
  2023. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet)) {
  2024. WriteObject_XmlSchemaMaxExclusiveFacet (((System.Xml.Schema.XmlSchemaMaxExclusiveFacet) ob.@Facets[n113]), "maxExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2025. }
  2026. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet)) {
  2027. WriteObject_XmlSchemaMinInclusiveFacet (((System.Xml.Schema.XmlSchemaMinInclusiveFacet) ob.@Facets[n113]), "minInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2028. }
  2029. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet)) {
  2030. WriteObject_XmlSchemaMinExclusiveFacet (((System.Xml.Schema.XmlSchemaMinExclusiveFacet) ob.@Facets[n113]), "minExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2031. }
  2032. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet)) {
  2033. WriteObject_XmlSchemaWhiteSpaceFacet (((System.Xml.Schema.XmlSchemaWhiteSpaceFacet) ob.@Facets[n113]), "whiteSpace", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2034. }
  2035. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaPatternFacet)) {
  2036. WriteObject_XmlSchemaPatternFacet (((System.Xml.Schema.XmlSchemaPatternFacet) ob.@Facets[n113]), "pattern", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2037. }
  2038. else throw CreateUnknownTypeException (ob.@Facets[n113]);
  2039. }
  2040. }
  2041. if (ob.@Attributes != null) {
  2042. for (int n114 = 0; n114 < [email protected]; n114++) {
  2043. if (ob.@Attributes[n114] == null) { }
  2044. else if (ob.@Attributes[n114].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  2045. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n114]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2046. }
  2047. else if (ob.@Attributes[n114].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  2048. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n114]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2049. }
  2050. else throw CreateUnknownTypeException (ob.@Attributes[n114]);
  2051. }
  2052. }
  2053. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2054. if (writeWrappingElem) WriteEndElement (ob);
  2055. }
  2056. protected override void InitCallbacks ()
  2057. {
  2058. }
  2059. }
  2060. }