XmlSchemaSerializer.cs 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450
  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. XmlElement o52 = o51 as XmlElement;
  985. if (o52 == null) throw CreateUnknownTypeException (o52);
  986. WriteElementLiteral (o52, "", "", false, true);
  987. }
  988. }
  989. if (writeWrappingElem) WriteEndElement (ob);
  990. }
  991. void WriteObject_XmlSchemaDocumentation (System.Xml.Schema.XmlSchemaDocumentation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  992. {
  993. if (ob == null)
  994. {
  995. if (isNullable)
  996. WriteNullTagLiteral(element, namesp);
  997. return;
  998. }
  999. System.Type type = ob.GetType ();
  1000. if (type == typeof(System.Xml.Schema.XmlSchemaDocumentation))
  1001. ;
  1002. else {
  1003. throw CreateUnknownTypeException (ob);
  1004. }
  1005. if (writeWrappingElem) {
  1006. WriteStartElement (element, namesp, ob);
  1007. }
  1008. if (needType) WriteXsiType("XmlSchemaDocumentation", "http://www.w3.org/2001/XMLSchema");
  1009. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1010. WriteAttribute ("source", "", ob.@Source);
  1011. WriteAttribute ("xml:lang", "", ob.@Language);
  1012. if (ob.@Markup != null) {
  1013. foreach (XmlNode o53 in ob.@Markup) {
  1014. XmlElement o54 = o53 as XmlElement;
  1015. if (o54 == null) throw CreateUnknownTypeException (o54);
  1016. WriteElementLiteral (o54, "", "", false, true);
  1017. }
  1018. }
  1019. if (writeWrappingElem) WriteEndElement (ob);
  1020. }
  1021. void WriteObject_XmlSchemaAttributeGroupRef (System.Xml.Schema.XmlSchemaAttributeGroupRef ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1022. {
  1023. if (ob == null)
  1024. {
  1025. if (isNullable)
  1026. WriteNullTagLiteral(element, namesp);
  1027. return;
  1028. }
  1029. System.Type type = ob.GetType ();
  1030. if (type == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef))
  1031. ;
  1032. else {
  1033. throw CreateUnknownTypeException (ob);
  1034. }
  1035. if (writeWrappingElem) {
  1036. WriteStartElement (element, namesp, ob);
  1037. }
  1038. if (needType) WriteXsiType("XmlSchemaAttributeGroupRef", "http://www.w3.org/2001/XMLSchema");
  1039. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1040. ICollection o55 = ob.@UnhandledAttributes;
  1041. if (o55 != null) {
  1042. foreach (XmlAttribute o56 in o55)
  1043. if (o56.NamespaceURI != xmlNamespace)
  1044. WriteXmlAttribute (o56, ob);
  1045. }
  1046. WriteAttribute ("id", "", ob.@Id);
  1047. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  1048. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1049. if (writeWrappingElem) WriteEndElement (ob);
  1050. }
  1051. void WriteObject_XmlSchemaAnyAttribute (System.Xml.Schema.XmlSchemaAnyAttribute ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1052. {
  1053. if (ob == null)
  1054. {
  1055. if (isNullable)
  1056. WriteNullTagLiteral(element, namesp);
  1057. return;
  1058. }
  1059. System.Type type = ob.GetType ();
  1060. if (type == typeof(System.Xml.Schema.XmlSchemaAnyAttribute))
  1061. ;
  1062. else {
  1063. throw CreateUnknownTypeException (ob);
  1064. }
  1065. if (writeWrappingElem) {
  1066. WriteStartElement (element, namesp, ob);
  1067. }
  1068. if (needType) WriteXsiType("XmlSchemaAnyAttribute", "http://www.w3.org/2001/XMLSchema");
  1069. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1070. ICollection o57 = ob.@UnhandledAttributes;
  1071. if (o57 != null) {
  1072. foreach (XmlAttribute o58 in o57)
  1073. if (o58.NamespaceURI != xmlNamespace)
  1074. WriteXmlAttribute (o58, ob);
  1075. }
  1076. WriteAttribute ("id", "", ob.@Id);
  1077. WriteAttribute ("namespace", "", ob.@Namespace);
  1078. if (ob.@ProcessContents != ((System.Xml.Schema.XmlSchemaContentProcessing) System.Xml.Schema.XmlSchemaContentProcessing.None)) {
  1079. WriteAttribute ("processContents", "", GetEnumValue_XmlSchemaContentProcessing (ob.@ProcessContents));
  1080. }
  1081. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1082. if (writeWrappingElem) WriteEndElement (ob);
  1083. }
  1084. void WriteObject_XmlSchemaSequence (System.Xml.Schema.XmlSchemaSequence ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1085. {
  1086. if (ob == null)
  1087. {
  1088. if (isNullable)
  1089. WriteNullTagLiteral(element, namesp);
  1090. return;
  1091. }
  1092. System.Type type = ob.GetType ();
  1093. if (type == typeof(System.Xml.Schema.XmlSchemaSequence))
  1094. ;
  1095. else {
  1096. throw CreateUnknownTypeException (ob);
  1097. }
  1098. if (writeWrappingElem) {
  1099. WriteStartElement (element, namesp, ob);
  1100. }
  1101. if (needType) WriteXsiType("XmlSchemaSequence", "http://www.w3.org/2001/XMLSchema");
  1102. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1103. ICollection o59 = ob.@UnhandledAttributes;
  1104. if (o59 != null) {
  1105. foreach (XmlAttribute o60 in o59)
  1106. if (o60.NamespaceURI != xmlNamespace)
  1107. WriteXmlAttribute (o60, ob);
  1108. }
  1109. WriteAttribute ("id", "", ob.@Id);
  1110. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1111. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1112. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1113. if (ob.@Items != null) {
  1114. for (int n61 = 0; n61 < [email protected]; n61++) {
  1115. if (ob.@Items[n61] == null) { }
  1116. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaSequence)) {
  1117. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Items[n61]), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1118. }
  1119. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaChoice)) {
  1120. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Items[n61]), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1121. }
  1122. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaGroupRef)) {
  1123. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Items[n61]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1124. }
  1125. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  1126. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n61]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1127. }
  1128. else if (ob.@Items[n61].GetType() == typeof(System.Xml.Schema.XmlSchemaAny)) {
  1129. WriteObject_XmlSchemaAny (((System.Xml.Schema.XmlSchemaAny) ob.@Items[n61]), "any", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1130. }
  1131. else throw CreateUnknownTypeException (ob.@Items[n61]);
  1132. }
  1133. }
  1134. if (writeWrappingElem) WriteEndElement (ob);
  1135. }
  1136. void WriteObject_XmlSchemaChoice (System.Xml.Schema.XmlSchemaChoice ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1137. {
  1138. if (ob == null)
  1139. {
  1140. if (isNullable)
  1141. WriteNullTagLiteral(element, namesp);
  1142. return;
  1143. }
  1144. System.Type type = ob.GetType ();
  1145. if (type == typeof(System.Xml.Schema.XmlSchemaChoice))
  1146. ;
  1147. else {
  1148. throw CreateUnknownTypeException (ob);
  1149. }
  1150. if (writeWrappingElem) {
  1151. WriteStartElement (element, namesp, ob);
  1152. }
  1153. if (needType) WriteXsiType("XmlSchemaChoice", "http://www.w3.org/2001/XMLSchema");
  1154. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1155. ICollection o62 = ob.@UnhandledAttributes;
  1156. if (o62 != null) {
  1157. foreach (XmlAttribute o63 in o62)
  1158. if (o63.NamespaceURI != xmlNamespace)
  1159. WriteXmlAttribute (o63, ob);
  1160. }
  1161. WriteAttribute ("id", "", ob.@Id);
  1162. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1163. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1164. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1165. if (ob.@Items != null) {
  1166. for (int n64 = 0; n64 < [email protected]; n64++) {
  1167. if (ob.@Items[n64] == null) { }
  1168. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaGroupRef)) {
  1169. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Items[n64]), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1170. }
  1171. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaElement)) {
  1172. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n64]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1173. }
  1174. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaAny)) {
  1175. WriteObject_XmlSchemaAny (((System.Xml.Schema.XmlSchemaAny) ob.@Items[n64]), "any", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1176. }
  1177. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaSequence)) {
  1178. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Items[n64]), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1179. }
  1180. else if (ob.@Items[n64].GetType() == typeof(System.Xml.Schema.XmlSchemaChoice)) {
  1181. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Items[n64]), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1182. }
  1183. else throw CreateUnknownTypeException (ob.@Items[n64]);
  1184. }
  1185. }
  1186. if (writeWrappingElem) WriteEndElement (ob);
  1187. }
  1188. void WriteObject_XmlSchemaAll (System.Xml.Schema.XmlSchemaAll ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1189. {
  1190. if (ob == null)
  1191. {
  1192. if (isNullable)
  1193. WriteNullTagLiteral(element, namesp);
  1194. return;
  1195. }
  1196. System.Type type = ob.GetType ();
  1197. if (type == typeof(System.Xml.Schema.XmlSchemaAll))
  1198. ;
  1199. else {
  1200. throw CreateUnknownTypeException (ob);
  1201. }
  1202. if (writeWrappingElem) {
  1203. WriteStartElement (element, namesp, ob);
  1204. }
  1205. if (needType) WriteXsiType("XmlSchemaAll", "http://www.w3.org/2001/XMLSchema");
  1206. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1207. ICollection o65 = ob.@UnhandledAttributes;
  1208. if (o65 != null) {
  1209. foreach (XmlAttribute o66 in o65)
  1210. if (o66.NamespaceURI != xmlNamespace)
  1211. WriteXmlAttribute (o66, ob);
  1212. }
  1213. WriteAttribute ("id", "", ob.@Id);
  1214. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1215. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1216. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1217. if (ob.@Items != null) {
  1218. for (int n67 = 0; n67 < [email protected]; n67++) {
  1219. WriteObject_XmlSchemaElement (((System.Xml.Schema.XmlSchemaElement) ob.@Items[n67]), "element", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1220. }
  1221. }
  1222. if (writeWrappingElem) WriteEndElement (ob);
  1223. }
  1224. void WriteObject_XmlSchemaComplexContent (System.Xml.Schema.XmlSchemaComplexContent ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1225. {
  1226. if (ob == null)
  1227. {
  1228. if (isNullable)
  1229. WriteNullTagLiteral(element, namesp);
  1230. return;
  1231. }
  1232. System.Type type = ob.GetType ();
  1233. if (type == typeof(System.Xml.Schema.XmlSchemaComplexContent))
  1234. ;
  1235. else {
  1236. throw CreateUnknownTypeException (ob);
  1237. }
  1238. if (writeWrappingElem) {
  1239. WriteStartElement (element, namesp, ob);
  1240. }
  1241. if (needType) WriteXsiType("XmlSchemaComplexContent", "http://www.w3.org/2001/XMLSchema");
  1242. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1243. ICollection o68 = ob.@UnhandledAttributes;
  1244. if (o68 != null) {
  1245. foreach (XmlAttribute o69 in o68)
  1246. if (o69.NamespaceURI != xmlNamespace)
  1247. WriteXmlAttribute (o69, ob);
  1248. }
  1249. WriteAttribute ("id", "", ob.@Id);
  1250. WriteAttribute ("mixed", "", (ob.@IsMixed?"true":"false"));
  1251. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1252. if (ob.@Content is System.Xml.Schema.XmlSchemaComplexContentExtension) {
  1253. WriteObject_XmlSchemaComplexContentExtension (((System.Xml.Schema.XmlSchemaComplexContentExtension) ob.@Content), "extension", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1254. }
  1255. else if (ob.@Content is System.Xml.Schema.XmlSchemaComplexContentRestriction) {
  1256. WriteObject_XmlSchemaComplexContentRestriction (((System.Xml.Schema.XmlSchemaComplexContentRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1257. }
  1258. if (writeWrappingElem) WriteEndElement (ob);
  1259. }
  1260. void WriteObject_XmlSchemaSimpleContent (System.Xml.Schema.XmlSchemaSimpleContent ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1261. {
  1262. if (ob == null)
  1263. {
  1264. if (isNullable)
  1265. WriteNullTagLiteral(element, namesp);
  1266. return;
  1267. }
  1268. System.Type type = ob.GetType ();
  1269. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleContent))
  1270. ;
  1271. else {
  1272. throw CreateUnknownTypeException (ob);
  1273. }
  1274. if (writeWrappingElem) {
  1275. WriteStartElement (element, namesp, ob);
  1276. }
  1277. if (needType) WriteXsiType("XmlSchemaSimpleContent", "http://www.w3.org/2001/XMLSchema");
  1278. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1279. ICollection o70 = ob.@UnhandledAttributes;
  1280. if (o70 != null) {
  1281. foreach (XmlAttribute o71 in o70)
  1282. if (o71.NamespaceURI != xmlNamespace)
  1283. WriteXmlAttribute (o71, ob);
  1284. }
  1285. WriteAttribute ("id", "", ob.@Id);
  1286. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1287. if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleContentExtension) {
  1288. WriteObject_XmlSchemaSimpleContentExtension (((System.Xml.Schema.XmlSchemaSimpleContentExtension) ob.@Content), "extension", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1289. }
  1290. else if (ob.@Content is System.Xml.Schema.XmlSchemaSimpleContentRestriction) {
  1291. WriteObject_XmlSchemaSimpleContentRestriction (((System.Xml.Schema.XmlSchemaSimpleContentRestriction) ob.@Content), "restriction", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1292. }
  1293. if (writeWrappingElem) WriteEndElement (ob);
  1294. }
  1295. void WriteObject_XmlSchemaGroupRef (System.Xml.Schema.XmlSchemaGroupRef ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1296. {
  1297. if (ob == null)
  1298. {
  1299. if (isNullable)
  1300. WriteNullTagLiteral(element, namesp);
  1301. return;
  1302. }
  1303. System.Type type = ob.GetType ();
  1304. if (type == typeof(System.Xml.Schema.XmlSchemaGroupRef))
  1305. ;
  1306. else {
  1307. throw CreateUnknownTypeException (ob);
  1308. }
  1309. if (writeWrappingElem) {
  1310. WriteStartElement (element, namesp, ob);
  1311. }
  1312. if (needType) WriteXsiType("XmlSchemaGroupRef", "http://www.w3.org/2001/XMLSchema");
  1313. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1314. ICollection o72 = ob.@UnhandledAttributes;
  1315. if (o72 != null) {
  1316. foreach (XmlAttribute o73 in o72)
  1317. if (o73.NamespaceURI != xmlNamespace)
  1318. WriteXmlAttribute (o73, ob);
  1319. }
  1320. WriteAttribute ("id", "", ob.@Id);
  1321. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1322. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1323. WriteAttribute ("ref", "", FromXmlQualifiedName (ob.@RefName));
  1324. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1325. if (writeWrappingElem) WriteEndElement (ob);
  1326. }
  1327. void WriteObject_XmlSchemaXPath (System.Xml.Schema.XmlSchemaXPath ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1328. {
  1329. if (ob == null)
  1330. {
  1331. if (isNullable)
  1332. WriteNullTagLiteral(element, namesp);
  1333. return;
  1334. }
  1335. System.Type type = ob.GetType ();
  1336. if (type == typeof(System.Xml.Schema.XmlSchemaXPath))
  1337. ;
  1338. else {
  1339. throw CreateUnknownTypeException (ob);
  1340. }
  1341. if (writeWrappingElem) {
  1342. WriteStartElement (element, namesp, ob);
  1343. }
  1344. if (needType) WriteXsiType("XmlSchemaXPath", "http://www.w3.org/2001/XMLSchema");
  1345. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1346. ICollection o74 = ob.@UnhandledAttributes;
  1347. if (o74 != null) {
  1348. foreach (XmlAttribute o75 in o74)
  1349. if (o75.NamespaceURI != xmlNamespace)
  1350. WriteXmlAttribute (o75, ob);
  1351. }
  1352. WriteAttribute ("id", "", ob.@Id);
  1353. if (ob.@XPath != null) {
  1354. WriteAttribute ("xpath", "", ob.@XPath);
  1355. }
  1356. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1357. if (writeWrappingElem) WriteEndElement (ob);
  1358. }
  1359. void WriteObject_XmlSchemaMaxLengthFacet (System.Xml.Schema.XmlSchemaMaxLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1360. {
  1361. if (ob == null)
  1362. {
  1363. if (isNullable)
  1364. WriteNullTagLiteral(element, namesp);
  1365. return;
  1366. }
  1367. System.Type type = ob.GetType ();
  1368. if (type == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet))
  1369. ;
  1370. else {
  1371. throw CreateUnknownTypeException (ob);
  1372. }
  1373. if (writeWrappingElem) {
  1374. WriteStartElement (element, namesp, ob);
  1375. }
  1376. if (needType) WriteXsiType("XmlSchemaMaxLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1377. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1378. ICollection o76 = ob.@UnhandledAttributes;
  1379. if (o76 != null) {
  1380. foreach (XmlAttribute o77 in o76)
  1381. if (o77.NamespaceURI != xmlNamespace)
  1382. WriteXmlAttribute (o77, ob);
  1383. }
  1384. WriteAttribute ("id", "", ob.@Id);
  1385. WriteAttribute ("value", "", ob.@Value);
  1386. if (ob.@IsFixed != false) {
  1387. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1388. }
  1389. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1390. if (writeWrappingElem) WriteEndElement (ob);
  1391. }
  1392. void WriteObject_XmlSchemaMinLengthFacet (System.Xml.Schema.XmlSchemaMinLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1393. {
  1394. if (ob == null)
  1395. {
  1396. if (isNullable)
  1397. WriteNullTagLiteral(element, namesp);
  1398. return;
  1399. }
  1400. System.Type type = ob.GetType ();
  1401. if (type == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet))
  1402. ;
  1403. else {
  1404. throw CreateUnknownTypeException (ob);
  1405. }
  1406. if (writeWrappingElem) {
  1407. WriteStartElement (element, namesp, ob);
  1408. }
  1409. if (needType) WriteXsiType("XmlSchemaMinLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1410. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1411. ICollection o78 = ob.@UnhandledAttributes;
  1412. if (o78 != null) {
  1413. foreach (XmlAttribute o79 in o78)
  1414. if (o79.NamespaceURI != xmlNamespace)
  1415. WriteXmlAttribute (o79, ob);
  1416. }
  1417. WriteAttribute ("id", "", ob.@Id);
  1418. WriteAttribute ("value", "", ob.@Value);
  1419. if (ob.@IsFixed != false) {
  1420. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1421. }
  1422. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1423. if (writeWrappingElem) WriteEndElement (ob);
  1424. }
  1425. void WriteObject_XmlSchemaLengthFacet (System.Xml.Schema.XmlSchemaLengthFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1426. {
  1427. if (ob == null)
  1428. {
  1429. if (isNullable)
  1430. WriteNullTagLiteral(element, namesp);
  1431. return;
  1432. }
  1433. System.Type type = ob.GetType ();
  1434. if (type == typeof(System.Xml.Schema.XmlSchemaLengthFacet))
  1435. ;
  1436. else {
  1437. throw CreateUnknownTypeException (ob);
  1438. }
  1439. if (writeWrappingElem) {
  1440. WriteStartElement (element, namesp, ob);
  1441. }
  1442. if (needType) WriteXsiType("XmlSchemaLengthFacet", "http://www.w3.org/2001/XMLSchema");
  1443. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1444. ICollection o80 = ob.@UnhandledAttributes;
  1445. if (o80 != null) {
  1446. foreach (XmlAttribute o81 in o80)
  1447. if (o81.NamespaceURI != xmlNamespace)
  1448. WriteXmlAttribute (o81, ob);
  1449. }
  1450. WriteAttribute ("id", "", ob.@Id);
  1451. WriteAttribute ("value", "", ob.@Value);
  1452. if (ob.@IsFixed != false) {
  1453. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1454. }
  1455. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1456. if (writeWrappingElem) WriteEndElement (ob);
  1457. }
  1458. void WriteObject_XmlSchemaFractionDigitsFacet (System.Xml.Schema.XmlSchemaFractionDigitsFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1459. {
  1460. if (ob == null)
  1461. {
  1462. if (isNullable)
  1463. WriteNullTagLiteral(element, namesp);
  1464. return;
  1465. }
  1466. System.Type type = ob.GetType ();
  1467. if (type == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet))
  1468. ;
  1469. else {
  1470. throw CreateUnknownTypeException (ob);
  1471. }
  1472. if (writeWrappingElem) {
  1473. WriteStartElement (element, namesp, ob);
  1474. }
  1475. if (needType) WriteXsiType("XmlSchemaFractionDigitsFacet", "http://www.w3.org/2001/XMLSchema");
  1476. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1477. ICollection o82 = ob.@UnhandledAttributes;
  1478. if (o82 != null) {
  1479. foreach (XmlAttribute o83 in o82)
  1480. if (o83.NamespaceURI != xmlNamespace)
  1481. WriteXmlAttribute (o83, ob);
  1482. }
  1483. WriteAttribute ("id", "", ob.@Id);
  1484. WriteAttribute ("value", "", ob.@Value);
  1485. if (ob.@IsFixed != false) {
  1486. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1487. }
  1488. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1489. if (writeWrappingElem) WriteEndElement (ob);
  1490. }
  1491. void WriteObject_XmlSchemaMaxInclusiveFacet (System.Xml.Schema.XmlSchemaMaxInclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1492. {
  1493. if (ob == null)
  1494. {
  1495. if (isNullable)
  1496. WriteNullTagLiteral(element, namesp);
  1497. return;
  1498. }
  1499. System.Type type = ob.GetType ();
  1500. if (type == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet))
  1501. ;
  1502. else {
  1503. throw CreateUnknownTypeException (ob);
  1504. }
  1505. if (writeWrappingElem) {
  1506. WriteStartElement (element, namesp, ob);
  1507. }
  1508. if (needType) WriteXsiType("XmlSchemaMaxInclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1509. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1510. ICollection o84 = ob.@UnhandledAttributes;
  1511. if (o84 != null) {
  1512. foreach (XmlAttribute o85 in o84)
  1513. if (o85.NamespaceURI != xmlNamespace)
  1514. WriteXmlAttribute (o85, ob);
  1515. }
  1516. WriteAttribute ("id", "", ob.@Id);
  1517. WriteAttribute ("value", "", ob.@Value);
  1518. if (ob.@IsFixed != false) {
  1519. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1520. }
  1521. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1522. if (writeWrappingElem) WriteEndElement (ob);
  1523. }
  1524. void WriteObject_XmlSchemaMaxExclusiveFacet (System.Xml.Schema.XmlSchemaMaxExclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1525. {
  1526. if (ob == null)
  1527. {
  1528. if (isNullable)
  1529. WriteNullTagLiteral(element, namesp);
  1530. return;
  1531. }
  1532. System.Type type = ob.GetType ();
  1533. if (type == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet))
  1534. ;
  1535. else {
  1536. throw CreateUnknownTypeException (ob);
  1537. }
  1538. if (writeWrappingElem) {
  1539. WriteStartElement (element, namesp, ob);
  1540. }
  1541. if (needType) WriteXsiType("XmlSchemaMaxExclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1542. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1543. ICollection o86 = ob.@UnhandledAttributes;
  1544. if (o86 != null) {
  1545. foreach (XmlAttribute o87 in o86)
  1546. if (o87.NamespaceURI != xmlNamespace)
  1547. WriteXmlAttribute (o87, ob);
  1548. }
  1549. WriteAttribute ("id", "", ob.@Id);
  1550. WriteAttribute ("value", "", ob.@Value);
  1551. if (ob.@IsFixed != false) {
  1552. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1553. }
  1554. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1555. if (writeWrappingElem) WriteEndElement (ob);
  1556. }
  1557. void WriteObject_XmlSchemaMinExclusiveFacet (System.Xml.Schema.XmlSchemaMinExclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1558. {
  1559. if (ob == null)
  1560. {
  1561. if (isNullable)
  1562. WriteNullTagLiteral(element, namesp);
  1563. return;
  1564. }
  1565. System.Type type = ob.GetType ();
  1566. if (type == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet))
  1567. ;
  1568. else {
  1569. throw CreateUnknownTypeException (ob);
  1570. }
  1571. if (writeWrappingElem) {
  1572. WriteStartElement (element, namesp, ob);
  1573. }
  1574. if (needType) WriteXsiType("XmlSchemaMinExclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1575. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1576. ICollection o88 = ob.@UnhandledAttributes;
  1577. if (o88 != null) {
  1578. foreach (XmlAttribute o89 in o88)
  1579. if (o89.NamespaceURI != xmlNamespace)
  1580. WriteXmlAttribute (o89, ob);
  1581. }
  1582. WriteAttribute ("id", "", ob.@Id);
  1583. WriteAttribute ("value", "", ob.@Value);
  1584. if (ob.@IsFixed != false) {
  1585. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1586. }
  1587. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1588. if (writeWrappingElem) WriteEndElement (ob);
  1589. }
  1590. void WriteObject_XmlSchemaEnumerationFacet (System.Xml.Schema.XmlSchemaEnumerationFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1591. {
  1592. if (ob == null)
  1593. {
  1594. if (isNullable)
  1595. WriteNullTagLiteral(element, namesp);
  1596. return;
  1597. }
  1598. System.Type type = ob.GetType ();
  1599. if (type == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet))
  1600. ;
  1601. else {
  1602. throw CreateUnknownTypeException (ob);
  1603. }
  1604. if (writeWrappingElem) {
  1605. WriteStartElement (element, namesp, ob);
  1606. }
  1607. if (needType) WriteXsiType("XmlSchemaEnumerationFacet", "http://www.w3.org/2001/XMLSchema");
  1608. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1609. ICollection o90 = ob.@UnhandledAttributes;
  1610. if (o90 != null) {
  1611. foreach (XmlAttribute o91 in o90)
  1612. if (o91.NamespaceURI != xmlNamespace)
  1613. WriteXmlAttribute (o91, ob);
  1614. }
  1615. WriteAttribute ("id", "", ob.@Id);
  1616. WriteAttribute ("value", "", ob.@Value);
  1617. if (ob.@IsFixed != false) {
  1618. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1619. }
  1620. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1621. if (writeWrappingElem) WriteEndElement (ob);
  1622. }
  1623. void WriteObject_XmlSchemaTotalDigitsFacet (System.Xml.Schema.XmlSchemaTotalDigitsFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1624. {
  1625. if (ob == null)
  1626. {
  1627. if (isNullable)
  1628. WriteNullTagLiteral(element, namesp);
  1629. return;
  1630. }
  1631. System.Type type = ob.GetType ();
  1632. if (type == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet))
  1633. ;
  1634. else {
  1635. throw CreateUnknownTypeException (ob);
  1636. }
  1637. if (writeWrappingElem) {
  1638. WriteStartElement (element, namesp, ob);
  1639. }
  1640. if (needType) WriteXsiType("XmlSchemaTotalDigitsFacet", "http://www.w3.org/2001/XMLSchema");
  1641. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1642. ICollection o92 = ob.@UnhandledAttributes;
  1643. if (o92 != null) {
  1644. foreach (XmlAttribute o93 in o92)
  1645. if (o93.NamespaceURI != xmlNamespace)
  1646. WriteXmlAttribute (o93, ob);
  1647. }
  1648. WriteAttribute ("id", "", ob.@Id);
  1649. WriteAttribute ("value", "", ob.@Value);
  1650. if (ob.@IsFixed != false) {
  1651. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1652. }
  1653. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1654. if (writeWrappingElem) WriteEndElement (ob);
  1655. }
  1656. void WriteObject_XmlSchemaMinInclusiveFacet (System.Xml.Schema.XmlSchemaMinInclusiveFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1657. {
  1658. if (ob == null)
  1659. {
  1660. if (isNullable)
  1661. WriteNullTagLiteral(element, namesp);
  1662. return;
  1663. }
  1664. System.Type type = ob.GetType ();
  1665. if (type == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet))
  1666. ;
  1667. else {
  1668. throw CreateUnknownTypeException (ob);
  1669. }
  1670. if (writeWrappingElem) {
  1671. WriteStartElement (element, namesp, ob);
  1672. }
  1673. if (needType) WriteXsiType("XmlSchemaMinInclusiveFacet", "http://www.w3.org/2001/XMLSchema");
  1674. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1675. ICollection o94 = ob.@UnhandledAttributes;
  1676. if (o94 != null) {
  1677. foreach (XmlAttribute o95 in o94)
  1678. if (o95.NamespaceURI != xmlNamespace)
  1679. WriteXmlAttribute (o95, ob);
  1680. }
  1681. WriteAttribute ("id", "", ob.@Id);
  1682. WriteAttribute ("value", "", ob.@Value);
  1683. if (ob.@IsFixed != false) {
  1684. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1685. }
  1686. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1687. if (writeWrappingElem) WriteEndElement (ob);
  1688. }
  1689. void WriteObject_XmlSchemaWhiteSpaceFacet (System.Xml.Schema.XmlSchemaWhiteSpaceFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1690. {
  1691. if (ob == null)
  1692. {
  1693. if (isNullable)
  1694. WriteNullTagLiteral(element, namesp);
  1695. return;
  1696. }
  1697. System.Type type = ob.GetType ();
  1698. if (type == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet))
  1699. ;
  1700. else {
  1701. throw CreateUnknownTypeException (ob);
  1702. }
  1703. if (writeWrappingElem) {
  1704. WriteStartElement (element, namesp, ob);
  1705. }
  1706. if (needType) WriteXsiType("XmlSchemaWhiteSpaceFacet", "http://www.w3.org/2001/XMLSchema");
  1707. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1708. ICollection o96 = ob.@UnhandledAttributes;
  1709. if (o96 != null) {
  1710. foreach (XmlAttribute o97 in o96)
  1711. if (o97.NamespaceURI != xmlNamespace)
  1712. WriteXmlAttribute (o97, ob);
  1713. }
  1714. WriteAttribute ("id", "", ob.@Id);
  1715. WriteAttribute ("value", "", ob.@Value);
  1716. if (ob.@IsFixed != false) {
  1717. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1718. }
  1719. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1720. if (writeWrappingElem) WriteEndElement (ob);
  1721. }
  1722. void WriteObject_XmlSchemaPatternFacet (System.Xml.Schema.XmlSchemaPatternFacet ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1723. {
  1724. if (ob == null)
  1725. {
  1726. if (isNullable)
  1727. WriteNullTagLiteral(element, namesp);
  1728. return;
  1729. }
  1730. System.Type type = ob.GetType ();
  1731. if (type == typeof(System.Xml.Schema.XmlSchemaPatternFacet))
  1732. ;
  1733. else {
  1734. throw CreateUnknownTypeException (ob);
  1735. }
  1736. if (writeWrappingElem) {
  1737. WriteStartElement (element, namesp, ob);
  1738. }
  1739. if (needType) WriteXsiType("XmlSchemaPatternFacet", "http://www.w3.org/2001/XMLSchema");
  1740. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1741. ICollection o98 = ob.@UnhandledAttributes;
  1742. if (o98 != null) {
  1743. foreach (XmlAttribute o99 in o98)
  1744. if (o99.NamespaceURI != xmlNamespace)
  1745. WriteXmlAttribute (o99, ob);
  1746. }
  1747. WriteAttribute ("id", "", ob.@Id);
  1748. WriteAttribute ("value", "", ob.@Value);
  1749. if (ob.@IsFixed != false) {
  1750. WriteAttribute ("fixed", "", (ob.@IsFixed?"true":"false"));
  1751. }
  1752. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1753. if (writeWrappingElem) WriteEndElement (ob);
  1754. }
  1755. void WriteObject_XmlSchemaContentProcessing (System.Xml.Schema.XmlSchemaContentProcessing ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1756. {
  1757. System.Type type = ob.GetType ();
  1758. if (type == typeof(System.Xml.Schema.XmlSchemaContentProcessing))
  1759. ;
  1760. else {
  1761. throw CreateUnknownTypeException (ob);
  1762. }
  1763. if (writeWrappingElem) {
  1764. WriteStartElement (element, namesp, ob);
  1765. }
  1766. if (needType) WriteXsiType("XmlSchemaContentProcessing", "");
  1767. Writer.WriteString (GetEnumValue_XmlSchemaContentProcessing (ob));
  1768. if (writeWrappingElem) WriteEndElement (ob);
  1769. }
  1770. string GetEnumValue_XmlSchemaContentProcessing (System.Xml.Schema.XmlSchemaContentProcessing val)
  1771. {
  1772. switch (val)
  1773. {
  1774. case System.Xml.Schema.XmlSchemaContentProcessing.Skip: return "skip";
  1775. case System.Xml.Schema.XmlSchemaContentProcessing.Lax: return "lax";
  1776. case System.Xml.Schema.XmlSchemaContentProcessing.Strict: return "strict";
  1777. default: return ((long)val).ToString(CultureInfo.InvariantCulture);
  1778. }
  1779. }
  1780. void WriteObject_XmlSchemaAny (System.Xml.Schema.XmlSchemaAny ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1781. {
  1782. if (ob == null)
  1783. {
  1784. if (isNullable)
  1785. WriteNullTagLiteral(element, namesp);
  1786. return;
  1787. }
  1788. System.Type type = ob.GetType ();
  1789. if (type == typeof(System.Xml.Schema.XmlSchemaAny))
  1790. ;
  1791. else {
  1792. throw CreateUnknownTypeException (ob);
  1793. }
  1794. if (writeWrappingElem) {
  1795. WriteStartElement (element, namesp, ob);
  1796. }
  1797. if (needType) WriteXsiType("XmlSchemaAny", "http://www.w3.org/2001/XMLSchema");
  1798. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1799. ICollection o100 = ob.@UnhandledAttributes;
  1800. if (o100 != null) {
  1801. foreach (XmlAttribute o101 in o100)
  1802. if (o101.NamespaceURI != xmlNamespace)
  1803. WriteXmlAttribute (o101, ob);
  1804. }
  1805. WriteAttribute ("id", "", ob.@Id);
  1806. WriteAttribute ("minOccurs", "", ob.@MinOccursString);
  1807. WriteAttribute ("maxOccurs", "", ob.@MaxOccursString);
  1808. WriteAttribute ("namespace", "", ob.@Namespace);
  1809. if (ob.@ProcessContents != ((System.Xml.Schema.XmlSchemaContentProcessing) System.Xml.Schema.XmlSchemaContentProcessing.None)) {
  1810. WriteAttribute ("processContents", "", GetEnumValue_XmlSchemaContentProcessing (ob.@ProcessContents));
  1811. }
  1812. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1813. if (writeWrappingElem) WriteEndElement (ob);
  1814. }
  1815. void WriteObject_XmlSchemaComplexContentExtension (System.Xml.Schema.XmlSchemaComplexContentExtension ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1816. {
  1817. if (ob == null)
  1818. {
  1819. if (isNullable)
  1820. WriteNullTagLiteral(element, namesp);
  1821. return;
  1822. }
  1823. System.Type type = ob.GetType ();
  1824. if (type == typeof(System.Xml.Schema.XmlSchemaComplexContentExtension))
  1825. ;
  1826. else {
  1827. throw CreateUnknownTypeException (ob);
  1828. }
  1829. if (writeWrappingElem) {
  1830. WriteStartElement (element, namesp, ob);
  1831. }
  1832. if (needType) WriteXsiType("XmlSchemaComplexContentExtension", "http://www.w3.org/2001/XMLSchema");
  1833. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1834. ICollection o102 = ob.@UnhandledAttributes;
  1835. if (o102 != null) {
  1836. foreach (XmlAttribute o103 in o102)
  1837. if (o103.NamespaceURI != xmlNamespace)
  1838. WriteXmlAttribute (o103, ob);
  1839. }
  1840. WriteAttribute ("id", "", ob.@Id);
  1841. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1842. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1843. if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  1844. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1845. }
  1846. else if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  1847. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1848. }
  1849. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  1850. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1851. }
  1852. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  1853. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1854. }
  1855. if (ob.@Attributes != null) {
  1856. for (int n104 = 0; n104 < [email protected]; n104++) {
  1857. if (ob.@Attributes[n104] == null) { }
  1858. else if (ob.@Attributes[n104].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1859. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n104]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1860. }
  1861. else if (ob.@Attributes[n104].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1862. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n104]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1863. }
  1864. else throw CreateUnknownTypeException (ob.@Attributes[n104]);
  1865. }
  1866. }
  1867. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1868. if (writeWrappingElem) WriteEndElement (ob);
  1869. }
  1870. void WriteObject_XmlSchemaComplexContentRestriction (System.Xml.Schema.XmlSchemaComplexContentRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1871. {
  1872. if (ob == null)
  1873. {
  1874. if (isNullable)
  1875. WriteNullTagLiteral(element, namesp);
  1876. return;
  1877. }
  1878. System.Type type = ob.GetType ();
  1879. if (type == typeof(System.Xml.Schema.XmlSchemaComplexContentRestriction))
  1880. ;
  1881. else {
  1882. throw CreateUnknownTypeException (ob);
  1883. }
  1884. if (writeWrappingElem) {
  1885. WriteStartElement (element, namesp, ob);
  1886. }
  1887. if (needType) WriteXsiType("XmlSchemaComplexContentRestriction", "http://www.w3.org/2001/XMLSchema");
  1888. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1889. ICollection o105 = ob.@UnhandledAttributes;
  1890. if (o105 != null) {
  1891. foreach (XmlAttribute o106 in o105)
  1892. if (o106.NamespaceURI != xmlNamespace)
  1893. WriteXmlAttribute (o106, ob);
  1894. }
  1895. WriteAttribute ("id", "", ob.@Id);
  1896. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1897. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1898. if (ob.@Particle is System.Xml.Schema.XmlSchemaSequence) {
  1899. WriteObject_XmlSchemaSequence (((System.Xml.Schema.XmlSchemaSequence) ob.@Particle), "sequence", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1900. }
  1901. else if (ob.@Particle is System.Xml.Schema.XmlSchemaChoice) {
  1902. WriteObject_XmlSchemaChoice (((System.Xml.Schema.XmlSchemaChoice) ob.@Particle), "choice", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1903. }
  1904. else if (ob.@Particle is System.Xml.Schema.XmlSchemaGroupRef) {
  1905. WriteObject_XmlSchemaGroupRef (((System.Xml.Schema.XmlSchemaGroupRef) ob.@Particle), "group", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1906. }
  1907. else if (ob.@Particle is System.Xml.Schema.XmlSchemaAll) {
  1908. WriteObject_XmlSchemaAll (((System.Xml.Schema.XmlSchemaAll) ob.@Particle), "all", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1909. }
  1910. if (ob.@Attributes != null) {
  1911. for (int n107 = 0; n107 < [email protected]; n107++) {
  1912. if (ob.@Attributes[n107] == null) { }
  1913. else if (ob.@Attributes[n107].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1914. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n107]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1915. }
  1916. else if (ob.@Attributes[n107].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1917. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n107]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1918. }
  1919. else throw CreateUnknownTypeException (ob.@Attributes[n107]);
  1920. }
  1921. }
  1922. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1923. if (writeWrappingElem) WriteEndElement (ob);
  1924. }
  1925. void WriteObject_XmlSchemaSimpleContentExtension (System.Xml.Schema.XmlSchemaSimpleContentExtension ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1926. {
  1927. if (ob == null)
  1928. {
  1929. if (isNullable)
  1930. WriteNullTagLiteral(element, namesp);
  1931. return;
  1932. }
  1933. System.Type type = ob.GetType ();
  1934. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleContentExtension))
  1935. ;
  1936. else {
  1937. throw CreateUnknownTypeException (ob);
  1938. }
  1939. if (writeWrappingElem) {
  1940. WriteStartElement (element, namesp, ob);
  1941. }
  1942. if (needType) WriteXsiType("XmlSchemaSimpleContentExtension", "http://www.w3.org/2001/XMLSchema");
  1943. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1944. ICollection o108 = ob.@UnhandledAttributes;
  1945. if (o108 != null) {
  1946. foreach (XmlAttribute o109 in o108)
  1947. if (o109.NamespaceURI != xmlNamespace)
  1948. WriteXmlAttribute (o109, ob);
  1949. }
  1950. WriteAttribute ("id", "", ob.@Id);
  1951. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1952. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1953. if (ob.@Attributes != null) {
  1954. for (int n110 = 0; n110 < [email protected]; n110++) {
  1955. if (ob.@Attributes[n110] == null) { }
  1956. else if (ob.@Attributes[n110].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  1957. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n110]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1958. }
  1959. else if (ob.@Attributes[n110].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  1960. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n110]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1961. }
  1962. else throw CreateUnknownTypeException (ob.@Attributes[n110]);
  1963. }
  1964. }
  1965. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1966. if (writeWrappingElem) WriteEndElement (ob);
  1967. }
  1968. void WriteObject_XmlSchemaSimpleContentRestriction (System.Xml.Schema.XmlSchemaSimpleContentRestriction ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
  1969. {
  1970. if (ob == null)
  1971. {
  1972. if (isNullable)
  1973. WriteNullTagLiteral(element, namesp);
  1974. return;
  1975. }
  1976. System.Type type = ob.GetType ();
  1977. if (type == typeof(System.Xml.Schema.XmlSchemaSimpleContentRestriction))
  1978. ;
  1979. else {
  1980. throw CreateUnknownTypeException (ob);
  1981. }
  1982. if (writeWrappingElem) {
  1983. WriteStartElement (element, namesp, ob);
  1984. }
  1985. if (needType) WriteXsiType("XmlSchemaSimpleContentRestriction", "http://www.w3.org/2001/XMLSchema");
  1986. WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
  1987. ICollection o111 = ob.@UnhandledAttributes;
  1988. if (o111 != null) {
  1989. foreach (XmlAttribute o112 in o111)
  1990. if (o112.NamespaceURI != xmlNamespace)
  1991. WriteXmlAttribute (o112, ob);
  1992. }
  1993. WriteAttribute ("id", "", ob.@Id);
  1994. WriteAttribute ("base", "", FromXmlQualifiedName (ob.@BaseTypeName));
  1995. WriteObject_XmlSchemaAnnotation (ob.@Annotation, "annotation", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1996. WriteObject_XmlSchemaSimpleType (ob.@BaseType, "simpleType", "http://www.w3.org/2001/XMLSchema", false, false, true);
  1997. if (ob.@Facets != null) {
  1998. for (int n113 = 0; n113 < [email protected]; n113++) {
  1999. if (ob.@Facets[n113] == null) { }
  2000. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaEnumerationFacet)) {
  2001. WriteObject_XmlSchemaEnumerationFacet (((System.Xml.Schema.XmlSchemaEnumerationFacet) ob.@Facets[n113]), "enumeration", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2002. }
  2003. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxLengthFacet)) {
  2004. WriteObject_XmlSchemaMaxLengthFacet (((System.Xml.Schema.XmlSchemaMaxLengthFacet) ob.@Facets[n113]), "maxLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2005. }
  2006. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMinLengthFacet)) {
  2007. WriteObject_XmlSchemaMinLengthFacet (((System.Xml.Schema.XmlSchemaMinLengthFacet) ob.@Facets[n113]), "minLength", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2008. }
  2009. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaLengthFacet)) {
  2010. WriteObject_XmlSchemaLengthFacet (((System.Xml.Schema.XmlSchemaLengthFacet) ob.@Facets[n113]), "length", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2011. }
  2012. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaFractionDigitsFacet)) {
  2013. WriteObject_XmlSchemaFractionDigitsFacet (((System.Xml.Schema.XmlSchemaFractionDigitsFacet) ob.@Facets[n113]), "fractionDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2014. }
  2015. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaTotalDigitsFacet)) {
  2016. WriteObject_XmlSchemaTotalDigitsFacet (((System.Xml.Schema.XmlSchemaTotalDigitsFacet) ob.@Facets[n113]), "totalDigits", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2017. }
  2018. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxInclusiveFacet)) {
  2019. WriteObject_XmlSchemaMaxInclusiveFacet (((System.Xml.Schema.XmlSchemaMaxInclusiveFacet) ob.@Facets[n113]), "maxInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2020. }
  2021. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMaxExclusiveFacet)) {
  2022. WriteObject_XmlSchemaMaxExclusiveFacet (((System.Xml.Schema.XmlSchemaMaxExclusiveFacet) ob.@Facets[n113]), "maxExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2023. }
  2024. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMinInclusiveFacet)) {
  2025. WriteObject_XmlSchemaMinInclusiveFacet (((System.Xml.Schema.XmlSchemaMinInclusiveFacet) ob.@Facets[n113]), "minInclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2026. }
  2027. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaMinExclusiveFacet)) {
  2028. WriteObject_XmlSchemaMinExclusiveFacet (((System.Xml.Schema.XmlSchemaMinExclusiveFacet) ob.@Facets[n113]), "minExclusive", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2029. }
  2030. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaWhiteSpaceFacet)) {
  2031. WriteObject_XmlSchemaWhiteSpaceFacet (((System.Xml.Schema.XmlSchemaWhiteSpaceFacet) ob.@Facets[n113]), "whiteSpace", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2032. }
  2033. else if (ob.@Facets[n113].GetType() == typeof(System.Xml.Schema.XmlSchemaPatternFacet)) {
  2034. WriteObject_XmlSchemaPatternFacet (((System.Xml.Schema.XmlSchemaPatternFacet) ob.@Facets[n113]), "pattern", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2035. }
  2036. else throw CreateUnknownTypeException (ob.@Facets[n113]);
  2037. }
  2038. }
  2039. if (ob.@Attributes != null) {
  2040. for (int n114 = 0; n114 < [email protected]; n114++) {
  2041. if (ob.@Attributes[n114] == null) { }
  2042. else if (ob.@Attributes[n114].GetType() == typeof(System.Xml.Schema.XmlSchemaAttributeGroupRef)) {
  2043. WriteObject_XmlSchemaAttributeGroupRef (((System.Xml.Schema.XmlSchemaAttributeGroupRef) ob.@Attributes[n114]), "attributeGroup", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2044. }
  2045. else if (ob.@Attributes[n114].GetType() == typeof(System.Xml.Schema.XmlSchemaAttribute)) {
  2046. WriteObject_XmlSchemaAttribute (((System.Xml.Schema.XmlSchemaAttribute) ob.@Attributes[n114]), "attribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2047. }
  2048. else throw CreateUnknownTypeException (ob.@Attributes[n114]);
  2049. }
  2050. }
  2051. WriteObject_XmlSchemaAnyAttribute (ob.@AnyAttribute, "anyAttribute", "http://www.w3.org/2001/XMLSchema", false, false, true);
  2052. if (writeWrappingElem) WriteEndElement (ob);
  2053. }
  2054. protected override void InitCallbacks ()
  2055. {
  2056. }
  2057. }
  2058. }