XmlSerializationWriter.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. //
  2. // System.Xml.Serialization.XmlSerializationWriter.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Lluis Sanchez Gual ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2002
  9. //
  10. using System;
  11. using System.Collections;
  12. using System.Text;
  13. using System.Xml;
  14. using System.Xml.Schema;
  15. using System.Runtime.Serialization;
  16. namespace System.Xml.Serialization {
  17. public abstract class XmlSerializationWriter {
  18. #region Fields
  19. ObjectIDGenerator idGenerator;
  20. int qnameCount;
  21. ArrayList namespaces;
  22. XmlWriter writer;
  23. Queue referencedElements;
  24. Hashtable callbacks;
  25. #endregion // Fields
  26. #region Constructors
  27. [MonoTODO]
  28. protected XmlSerializationWriter ()
  29. {
  30. qnameCount = 0;
  31. }
  32. #endregion // Constructors
  33. #region Properties
  34. protected ArrayList Namespaces {
  35. get { return namespaces; }
  36. set { namespaces = value; }
  37. }
  38. protected XmlWriter Writer {
  39. get { return writer; }
  40. set { writer = value; }
  41. }
  42. #endregion // Properties
  43. #region Methods
  44. internal void Initialize (XmlWriter writer)
  45. {
  46. this.writer = writer;
  47. }
  48. internal virtual void WriteObject (object ob)
  49. {
  50. throw new NotImplementedException ();
  51. }
  52. protected void AddWriteCallback (Type type, string typeName, string typeNs, XmlSerializationWriteCallback callback)
  53. {
  54. WriteCallbackInfo info = new WriteCallbackInfo ();
  55. info.Type = type;
  56. info.TypeName = typeName;
  57. info.TypeNs = typeNs;
  58. info.Callback = callback;
  59. if (callbacks == null) callbacks = new Hashtable ();
  60. callbacks.Add (type, info);
  61. }
  62. protected Exception CreateMismatchChoiceException (string value, string elementName, string enumValue)
  63. {
  64. string message = String.Format ("Value of {0} mismatches the type of {1}, you need to set it to {2}.", elementName, value, enumValue);
  65. return new InvalidOperationException (message);
  66. }
  67. protected Exception CreateUnknownAnyElementException (string name, string ns)
  68. {
  69. string message = String.Format ("The XML element named '{0}' from namespace '{1}' was not expected. The XML element name and namespace must match those provided via XmlAnyElementAttribute(s).", name, ns);
  70. return new InvalidOperationException (message);
  71. }
  72. protected Exception CreateUnknownTypeException (object o)
  73. {
  74. return CreateUnknownTypeException (o.GetType ());
  75. }
  76. protected Exception CreateUnknownTypeException (Type type)
  77. {
  78. string message = String.Format ("The type {0} may not be used in this context.", type);
  79. return new InvalidOperationException (message);
  80. }
  81. protected static string FromByteArrayBase64 (byte[] value)
  82. {
  83. return XmlCustomFormatter.FromByteArrayBase64 (value);
  84. }
  85. protected static string FromByteArrayHex (byte[] value)
  86. {
  87. return XmlCustomFormatter.FromByteArrayHex (value);
  88. }
  89. protected static string FromChar (char value)
  90. {
  91. return XmlCustomFormatter.FromChar (value);
  92. }
  93. protected static string FromDate (DateTime value)
  94. {
  95. return XmlCustomFormatter.FromDate (value);
  96. }
  97. protected static string FromDateTime (DateTime value)
  98. {
  99. return XmlCustomFormatter.FromDateTime (value);
  100. }
  101. protected static string FromEnum (long value, string[] values, long[] ids)
  102. {
  103. return XmlCustomFormatter.FromEnum (value, values, ids);
  104. }
  105. protected static string FromTime (DateTime value)
  106. {
  107. return XmlCustomFormatter.FromTime (value);
  108. }
  109. protected static string FromXmlName (string name)
  110. {
  111. return XmlCustomFormatter.FromXmlName (name);
  112. }
  113. protected static string FromXmlNCName (string ncName)
  114. {
  115. return XmlCustomFormatter.FromXmlNCName (ncName);
  116. }
  117. protected static string FromXmlNmToken (string nmToken)
  118. {
  119. return XmlCustomFormatter.FromXmlNmToken (nmToken);
  120. }
  121. protected static string FromXmlNmTokens (string nmTokens)
  122. {
  123. return XmlCustomFormatter.FromXmlNmTokens (nmTokens);
  124. }
  125. [MonoTODO ("Implement")]
  126. protected string FromXmlQualifiedName (XmlQualifiedName xmlQualifiedName)
  127. {
  128. return GetQualifiedName (xmlQualifiedName.Name, xmlQualifiedName.Namespace);
  129. }
  130. private string GetId (object o, bool addToReferencesList)
  131. {
  132. if (idGenerator == null) idGenerator = new ObjectIDGenerator ();
  133. bool firstTime;
  134. long lid = idGenerator.GetId (o, out firstTime);
  135. return String.Format ("id{0}", lid);
  136. }
  137. bool AlreadyQueued (object ob)
  138. {
  139. if (idGenerator == null) return false;
  140. bool firstTime;
  141. idGenerator.HasId (ob, out firstTime);
  142. return !firstTime;
  143. }
  144. private string GetNamespacePrefix (string ns)
  145. {
  146. string prefix = Writer.LookupPrefix (ns);
  147. if (prefix == null)
  148. {
  149. prefix = String.Format ("q{0}", ++qnameCount);
  150. WriteAttribute ("xmlns", prefix, null, ns);
  151. }
  152. return prefix;
  153. }
  154. [MonoTODO ("Need to check for namespace conflicts before blindly allocating qN")]
  155. private string GetQualifiedName (string name, string ns)
  156. {
  157. return String.Format ("{0}:{1}", GetNamespacePrefix (ns), name);
  158. }
  159. protected abstract void InitCallbacks ();
  160. [MonoTODO ("Implement")]
  161. protected void TopLevelElement ()
  162. {
  163. throw new NotImplementedException ();
  164. }
  165. protected void WriteAttribute (string localName, byte[] value)
  166. {
  167. WriteAttribute (localName, String.Empty, value);
  168. }
  169. protected void WriteAttribute (string localName, string value)
  170. {
  171. WriteAttribute (String.Empty, localName, String.Empty, value);
  172. }
  173. protected void WriteAttribute (string localName, string ns, byte[] value)
  174. {
  175. if (value == null)
  176. return;
  177. Writer.WriteStartAttribute (localName, ns);
  178. WriteValue (value);
  179. Writer.WriteEndAttribute ();
  180. }
  181. protected void WriteAttribute (string localName, string ns, string value)
  182. {
  183. WriteAttribute (String.Empty, localName, ns, value);
  184. }
  185. protected void WriteAttribute (string prefix, string localName, string ns, string value)
  186. {
  187. if (value == null)
  188. return;
  189. Writer.WriteAttributeString (prefix, localName, ns, value);
  190. }
  191. protected void WriteElementEncoded (XmlNode node, string name, string ns, bool isNullable, bool any)
  192. {
  193. if (name != string.Empty)
  194. {
  195. if (node == null)
  196. {
  197. if (isNullable)
  198. WriteNullTagEncoded (name, ns);
  199. }
  200. else
  201. {
  202. Writer.WriteStartElement (name, ns);
  203. node.WriteTo (Writer);
  204. Writer.WriteEndElement ();
  205. }
  206. }
  207. else
  208. node.WriteTo (Writer);
  209. }
  210. protected void WriteElementLiteral (XmlNode node, string name, string ns, bool isNullable, bool any)
  211. {
  212. if (name != string.Empty)
  213. {
  214. if (node == null)
  215. {
  216. if (isNullable)
  217. WriteNullTagLiteral (name, ns);
  218. }
  219. else
  220. {
  221. Writer.WriteStartElement (name, ns);
  222. node.WriteTo (Writer);
  223. Writer.WriteEndElement ();
  224. }
  225. }
  226. else
  227. node.WriteTo (Writer);
  228. }
  229. protected void WriteElementQualifiedName (string localName, XmlQualifiedName value)
  230. {
  231. WriteElementQualifiedName (localName, String.Empty, value, null);
  232. }
  233. protected void WriteElementQualifiedName (string localName, string ns, XmlQualifiedName value)
  234. {
  235. WriteElementQualifiedName (localName, ns, value, null);
  236. }
  237. protected void WriteElementQualifiedName (string localName, XmlQualifiedName value, XmlQualifiedName xsiType)
  238. {
  239. WriteElementQualifiedName (localName, String.Empty, value, xsiType);
  240. }
  241. protected void WriteElementQualifiedName (string localName, string ns, XmlQualifiedName value, XmlQualifiedName xsiType)
  242. {
  243. localName = XmlCustomFormatter.FromXmlNCName (localName);
  244. WriteStartElement (localName, ns);
  245. Writer.WriteString (FromXmlQualifiedName (value));
  246. WriteEndElement ();
  247. }
  248. protected void WriteElementString (string localName, string value)
  249. {
  250. WriteElementString (localName, String.Empty, value, null);
  251. }
  252. protected void WriteElementString (string localName, string ns, string value)
  253. {
  254. WriteElementString (localName, ns, value, null);
  255. }
  256. protected void WriteElementString (string localName, string value, XmlQualifiedName xsiType)
  257. {
  258. WriteElementString (localName, String.Empty, value, xsiType);
  259. }
  260. [MonoTODO ("Implement")]
  261. protected void WriteElementString (string localName, string ns, string value, XmlQualifiedName xsiType)
  262. {
  263. if (value == null) return;
  264. if (xsiType != null) {
  265. localName = XmlCustomFormatter.FromXmlNCName (localName);
  266. WriteStartElement (localName, ns);
  267. WriteXsiType (xsiType.Name, xsiType.Namespace);
  268. Writer.WriteString (value);
  269. WriteEndElement ();
  270. }
  271. else
  272. Writer.WriteElementString (localName, ns, value);
  273. }
  274. protected void WriteElementStringRaw (string localName, byte[] value)
  275. {
  276. WriteElementStringRaw (localName, String.Empty, value, null);
  277. }
  278. protected void WriteElementStringRaw (string localName, string value)
  279. {
  280. WriteElementStringRaw (localName, String.Empty, value, null);
  281. }
  282. protected void WriteElementStringRaw (string localName, byte[] value, XmlQualifiedName xsiType)
  283. {
  284. WriteElementStringRaw (localName, String.Empty, value, xsiType);
  285. }
  286. protected void WriteElementStringRaw (string localName, string ns, byte[] value)
  287. {
  288. WriteElementStringRaw (localName, ns, value, null);
  289. }
  290. protected void WriteElementStringRaw (string localName, string ns, string value)
  291. {
  292. WriteElementStringRaw (localName, ns, value, null);
  293. }
  294. protected void WriteElementStringRaw (string localName, string value, XmlQualifiedName xsiType)
  295. {
  296. WriteElementStringRaw (localName, String.Empty, value, null);
  297. }
  298. [MonoTODO ("Implement")]
  299. protected void WriteElementStringRaw (string localName, string ns, byte[] value, XmlQualifiedName xsiType)
  300. {
  301. throw new NotImplementedException ();
  302. }
  303. [MonoTODO ("Implement")]
  304. protected void WriteElementStringRaw (string localName, string ns, string value, XmlQualifiedName xsiType)
  305. {
  306. localName = XmlCustomFormatter.FromXmlNCName (localName);
  307. WriteStartElement (localName, ns);
  308. if (xsiType != null)
  309. WriteXsiType (xsiType.Name, xsiType.Namespace);
  310. Writer.WriteRaw (value);
  311. WriteEndElement ();
  312. }
  313. protected void WriteEmptyTag (string name)
  314. {
  315. WriteEmptyTag (name, String.Empty);
  316. }
  317. [MonoTODO ("Verify")]
  318. protected void WriteEmptyTag (string name, string ns)
  319. {
  320. name = XmlCustomFormatter.FromXmlName (name);
  321. WriteStartElement (name, ns);
  322. WriteEndElement ();
  323. }
  324. protected void WriteEndElement ()
  325. {
  326. WriteEndElement (null);
  327. }
  328. [MonoTODO ("Implement")]
  329. protected void WriteEndElement (object o)
  330. {
  331. Writer.WriteEndElement ();
  332. }
  333. protected void WriteId (object o)
  334. {
  335. WriteAttribute ("id", GetId (o, true));
  336. }
  337. protected void WriteNamespaceDeclarations (XmlSerializerNamespaces ns)
  338. {
  339. if (ns == null)
  340. return;
  341. Hashtable tbl = ns.Namespaces;
  342. foreach (string key in tbl.Keys) {
  343. string val = tbl [key] as string;
  344. if (val == null)
  345. val = String.Empty;
  346. WriteAttribute ("xmlns", key, null, val);
  347. }
  348. }
  349. [MonoTODO ("Implement")]
  350. protected void WriteNullableQualifiedNameEncoded (string name, string ns, XmlQualifiedName value, XmlQualifiedName xsiType)
  351. {
  352. throw new NotImplementedException ();
  353. }
  354. [MonoTODO ("Implement")]
  355. protected void WriteNullableQualifiedNameLiteral (string name, string ns, XmlQualifiedName value)
  356. {
  357. throw new NotImplementedException ();
  358. }
  359. protected void WriteNullableStringEncoded (string name, string ns, string value, XmlQualifiedName xsiType)
  360. {
  361. if (value != null)
  362. WriteElementString (name, ns, value, xsiType);
  363. else
  364. WriteNullTagEncoded (name, ns);
  365. }
  366. [MonoTODO ("Implement")]
  367. protected void WriteNullableStringEncodedRaw (string name, string ns, byte[] value, XmlQualifiedName xsiType)
  368. {
  369. throw new NotImplementedException ();
  370. }
  371. [MonoTODO ("Implement")]
  372. protected void WriteNullableStringEncodedRaw (string name, string ns, string value, XmlQualifiedName xsiType)
  373. {
  374. throw new NotImplementedException ();
  375. }
  376. protected void WriteNullableStringLiteral (string name, string ns, string value)
  377. {
  378. if (value != null)
  379. WriteElementString (name, ns, value, null);
  380. else
  381. WriteNullTagLiteral (name, ns);
  382. }
  383. [MonoTODO ("Implement")]
  384. protected void WriteNullableStringLiteralRaw (string name, string ns, byte[] value)
  385. {
  386. throw new NotImplementedException ();
  387. }
  388. [MonoTODO ("Implement")]
  389. protected void WriteNullableStringLiteralRaw (string name, string ns, string value)
  390. {
  391. throw new NotImplementedException ();
  392. }
  393. protected void WriteNullTagEncoded (string name)
  394. {
  395. WriteNullTagEncoded (name, String.Empty);
  396. }
  397. protected void WriteNullTagEncoded (string name, string ns)
  398. {
  399. WriteStartElement (name, ns);
  400. WriteAttribute ("xsi","null", XmlSchema.InstanceNamespace, "1");
  401. WriteEndElement ();
  402. }
  403. protected void WriteNullTagLiteral (string name)
  404. {
  405. WriteNullTagLiteral (name, String.Empty);
  406. }
  407. protected void WriteNullTagLiteral (string name, string ns)
  408. {
  409. WriteStartElement (name, ns);
  410. WriteAttribute ("xsi","nil", XmlSchema.InstanceNamespace, "true");
  411. WriteEndElement ();
  412. }
  413. protected void WritePotentiallyReferencingElement (string n, string ns, object o)
  414. {
  415. WritePotentiallyReferencingElement (n, ns, o, null, false, false);
  416. }
  417. protected void WritePotentiallyReferencingElement (string n, string ns, object o, Type ambientType)
  418. {
  419. WritePotentiallyReferencingElement (n, ns, o, ambientType, false, false);
  420. }
  421. protected void WritePotentiallyReferencingElement (string n, string ns, object o, Type ambientType, bool suppressReference)
  422. {
  423. WritePotentiallyReferencingElement (n, ns, o, ambientType, suppressReference, false);
  424. }
  425. protected void WritePotentiallyReferencingElement (string n, string ns, object o, Type ambientType, bool suppressReference, bool isNullable)
  426. {
  427. if (o == null)
  428. {
  429. if (isNullable) WriteNullTagEncoded (n, ns);
  430. return;
  431. }
  432. WriteStartElement (n, ns, o, true);
  433. CheckReferenceQueue ();
  434. if (callbacks.ContainsKey (o.GetType ()))
  435. {
  436. WriteCallbackInfo info = (WriteCallbackInfo) callbacks[o.GetType()];
  437. if (o.GetType ().IsEnum) {
  438. info.Callback (o);
  439. }
  440. else if (suppressReference) {
  441. Writer.WriteAttributeString ("id", GetId (o, false));
  442. if (ambientType != o.GetType ()) WriteXsiType(info.TypeName, info.TypeNs);
  443. info.Callback (o);
  444. }
  445. else {
  446. if (!AlreadyQueued (o)) referencedElements.Enqueue (o);
  447. Writer.WriteAttributeString ("href", "#" + GetId (o, true));
  448. }
  449. }
  450. else
  451. {
  452. // Must be a primitive type
  453. TypeData td = TypeTranslator.GetTypeData (o.GetType ());
  454. if (td.SchemaType != SchemaTypes.Primitive)
  455. throw new InvalidOperationException ("Invalid type: " + o.GetType().FullName);
  456. WriteXsiType(td.XmlType, XmlSchema.Namespace);
  457. Writer.WriteString (XmlCustomFormatter.ToXmlString (o));
  458. }
  459. WriteEndElement (o);
  460. }
  461. protected void WriteReferencedElements ()
  462. {
  463. if (referencedElements == null) return;
  464. if (callbacks == null) return;
  465. while (referencedElements.Count > 0)
  466. {
  467. object o = referencedElements.Dequeue ();
  468. TypeData td = TypeTranslator.GetTypeData (o.GetType ());
  469. WriteCallbackInfo info = (WriteCallbackInfo) callbacks[o.GetType()];
  470. WriteStartElement (info.TypeName, info.TypeNs, o, true);
  471. Writer.WriteAttributeString ("id", GetId (o, false));
  472. if (td.SchemaType != SchemaTypes.Array) // Array use its own "arrayType" attribute
  473. WriteXsiType(info.TypeName, info.TypeNs);
  474. info.Callback (o);
  475. WriteEndElement (o);
  476. }
  477. }
  478. protected void WriteReferencingElement (string n, string ns, object o)
  479. {
  480. WriteReferencingElement (n, ns, o, false);
  481. }
  482. protected void WriteReferencingElement (string n, string ns, object o, bool isNullable)
  483. {
  484. if (o == null)
  485. {
  486. if (isNullable) WriteNullTagEncoded (n, ns);
  487. return;
  488. }
  489. else
  490. {
  491. CheckReferenceQueue ();
  492. if (!AlreadyQueued (o)) referencedElements.Enqueue (o);
  493. Writer.WriteStartElement (n, ns);
  494. Writer.WriteAttributeString ("href", "#" + GetId (o, true));
  495. Writer.WriteEndElement ();
  496. }
  497. }
  498. void CheckReferenceQueue ()
  499. {
  500. if (referencedElements == null)
  501. {
  502. referencedElements = new Queue ();
  503. InitCallbacks ();
  504. }
  505. }
  506. [MonoTODO ("Implement")]
  507. protected void WriteSerializable (IXmlSerializable serializable, string name, string ns, bool isNullable)
  508. {
  509. throw new NotImplementedException ();
  510. }
  511. protected void WriteStartDocument ()
  512. {
  513. if (Writer.WriteState == WriteState.Start)
  514. Writer.WriteStartDocument ();
  515. }
  516. protected void WriteStartElement (string name)
  517. {
  518. WriteStartElement (name, String.Empty, null, false);
  519. }
  520. protected void WriteStartElement (string name, string ns)
  521. {
  522. WriteStartElement (name, ns, null, false);
  523. }
  524. protected void WriteStartElement (string name, string ns, bool writePrefixed)
  525. {
  526. WriteStartElement (name, ns, null, writePrefixed);
  527. }
  528. protected void WriteStartElement (string name, string ns, object o)
  529. {
  530. WriteStartElement (name, ns, o, false);
  531. }
  532. [MonoTODO]
  533. protected void WriteStartElement (string name, string ns, object o, bool writePrefixed)
  534. {
  535. WriteState oldState = Writer.WriteState;
  536. if (writePrefixed && ns != string.Empty) {
  537. name = XmlCustomFormatter.FromXmlName (name);
  538. string prefix = Writer.LookupPrefix (ns);
  539. if (prefix == null) prefix = "q" + (++qnameCount);
  540. Writer.WriteStartElement (prefix, name, ns);
  541. } else
  542. Writer.WriteStartElement (name, ns);
  543. if ((o == null) || (oldState == WriteState.Prolog && !TypeTranslator.IsPrimitive (o.GetType()))) {
  544. WriteAttribute ("xmlns","xsd",XmlSchema.Namespace,XmlSchema.Namespace);
  545. WriteAttribute ("xmlns","xsi",XmlSchema.InstanceNamespace,XmlSchema.InstanceNamespace);
  546. }
  547. }
  548. protected void WriteTypedPrimitive (string name, string ns, object o, bool xsiType)
  549. {
  550. string value;
  551. name = XmlCustomFormatter.FromXmlName (name);
  552. Writer.WriteStartElement (name, ns);
  553. if (o is XmlQualifiedName)
  554. value = FromXmlQualifiedName ((XmlQualifiedName) o);
  555. else
  556. value = XmlCustomFormatter.ToXmlString (o);
  557. if (xsiType)
  558. {
  559. TypeData td = TypeTranslator.GetTypeData (o.GetType ());
  560. if (td.SchemaType != SchemaTypes.Primitive)
  561. throw new InvalidOperationException ("Invalid type: " + o.GetType().FullName);
  562. WriteXsiType (td.XmlType, XmlSchema.Namespace);
  563. }
  564. WriteValue (value);
  565. Writer.WriteEndElement ();
  566. }
  567. protected void WriteValue (byte[] value)
  568. {
  569. Writer.WriteBase64 (value, 0, value.Length);
  570. }
  571. protected void WriteValue (string value)
  572. {
  573. Writer.WriteString (value);
  574. }
  575. protected void WriteXmlAttribute (XmlNode node)
  576. {
  577. WriteXmlAttribute (node, null);
  578. }
  579. [MonoTODO ("Implement")]
  580. protected void WriteXmlAttribute (XmlNode node, object container)
  581. {
  582. if (!(node is XmlAttribute))
  583. throw new InvalidOperationException ("The node must be either type XmlAttribute or a derived type.");
  584. throw new NotImplementedException ();
  585. }
  586. protected void WriteXsiType (string name, string ns)
  587. {
  588. if (ns != null && ns != string.Empty)
  589. WriteAttribute (GetNamespacePrefix (XmlSchema.InstanceNamespace), "type", ns, GetQualifiedName (name, ns));
  590. else
  591. WriteAttribute (GetNamespacePrefix (XmlSchema.InstanceNamespace), "type", ns, name);
  592. }
  593. #endregion
  594. class WriteCallbackInfo
  595. {
  596. public Type Type;
  597. public string TypeName;
  598. public string TypeNs;
  599. public XmlSerializationWriteCallback Callback;
  600. }
  601. }
  602. }