_Events.cs 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. //------------------------------------------------------------------------------
  2. // <copyright file="_Events.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">Microsoft</owner>
  6. //------------------------------------------------------------------------------
  7. namespace System.Xml.Serialization {
  8. using System.IO;
  9. using System;
  10. using System.Collections;
  11. using System.ComponentModel;
  12. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventHandler"]/*' />
  13. /// <devdoc>
  14. /// <para>[To be supplied.]</para>
  15. /// </devdoc>
  16. public delegate void XmlAttributeEventHandler(object sender, XmlAttributeEventArgs e);
  17. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs"]/*' />
  18. /// <devdoc>
  19. /// <para>[To be supplied.]</para>
  20. /// </devdoc>
  21. public class XmlAttributeEventArgs : EventArgs {
  22. object o;
  23. XmlAttribute attr;
  24. string qnames;
  25. int lineNumber;
  26. int linePosition;
  27. internal XmlAttributeEventArgs(XmlAttribute attr, int lineNumber, int linePosition, object o, string qnames) {
  28. this.attr = attr;
  29. this.o = o;
  30. this.qnames = qnames;
  31. this.lineNumber = lineNumber;
  32. this.linePosition = linePosition;
  33. }
  34. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.ObjectBeingDeserialized"]/*' />
  35. /// <devdoc>
  36. /// <para>[To be supplied.]</para>
  37. /// </devdoc>
  38. public object ObjectBeingDeserialized {
  39. get { return o; }
  40. }
  41. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.Attr"]/*' />
  42. /// <devdoc>
  43. /// <para>[To be supplied.]</para>
  44. /// </devdoc>
  45. public XmlAttribute Attr {
  46. get { return attr; }
  47. }
  48. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.LineNumber"]/*' />
  49. /// <devdoc>
  50. /// <para>
  51. /// Gets the current line number.
  52. /// </para>
  53. /// </devdoc>
  54. public int LineNumber {
  55. get { return lineNumber; }
  56. }
  57. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.LinePosition"]/*' />
  58. /// <devdoc>
  59. /// <para>
  60. /// Gets the current line position.
  61. /// </para>
  62. /// </devdoc>
  63. public int LinePosition {
  64. get { return linePosition; }
  65. }
  66. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.Attributes"]/*' />
  67. /// <devdoc>
  68. /// <para>
  69. /// List the qnames of attributes expected in the current context.
  70. /// </para>
  71. /// </devdoc>
  72. public string ExpectedAttributes {
  73. get { return qnames == null ? string.Empty : qnames; }
  74. }
  75. }
  76. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventHandler"]/*' />
  77. public delegate void XmlElementEventHandler(object sender, XmlElementEventArgs e);
  78. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs"]/*' />
  79. public class XmlElementEventArgs : EventArgs {
  80. object o;
  81. XmlElement elem;
  82. string qnames;
  83. int lineNumber;
  84. int linePosition;
  85. internal XmlElementEventArgs(XmlElement elem, int lineNumber, int linePosition, object o, string qnames) {
  86. this.elem = elem;
  87. this.o = o;
  88. this.qnames = qnames;
  89. this.lineNumber = lineNumber;
  90. this.linePosition = linePosition;
  91. }
  92. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.ObjectBeingDeserialized"]/*' />
  93. public object ObjectBeingDeserialized {
  94. get { return o; }
  95. }
  96. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.Attr"]/*' />
  97. public XmlElement Element {
  98. get { return elem; }
  99. }
  100. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.LineNumber"]/*' />
  101. public int LineNumber {
  102. get { return lineNumber; }
  103. }
  104. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.LinePosition"]/*' />
  105. public int LinePosition {
  106. get { return linePosition; }
  107. }
  108. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.ExpectedElements"]/*' />
  109. /// <devdoc>
  110. /// <para>
  111. /// List of qnames of elements expected in the current context.
  112. /// </para>
  113. /// </devdoc>
  114. public string ExpectedElements {
  115. get { return qnames == null ? string.Empty : qnames; }
  116. }
  117. }
  118. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventHandler"]/*' />
  119. /// <devdoc>
  120. /// <para>[To be supplied.]</para>
  121. /// </devdoc>
  122. public delegate void XmlNodeEventHandler(object sender, XmlNodeEventArgs e);
  123. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs"]/*' />
  124. /// <devdoc>
  125. /// <para>[To be supplied.]</para>
  126. /// </devdoc>
  127. public class XmlNodeEventArgs : EventArgs {
  128. object o;
  129. XmlNode xmlNode;
  130. int lineNumber;
  131. int linePosition;
  132. internal XmlNodeEventArgs(XmlNode xmlNode, int lineNumber, int linePosition, object o) {
  133. this.o = o;
  134. this.xmlNode = xmlNode;
  135. this.lineNumber = lineNumber;
  136. this.linePosition = linePosition;
  137. }
  138. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.ObjectBeingDeserialized"]/*' />
  139. /// <devdoc>
  140. /// <para>[To be supplied.]</para>
  141. /// </devdoc>
  142. public object ObjectBeingDeserialized {
  143. get { return o; }
  144. }
  145. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.NodeType"]/*' />
  146. /// <devdoc>
  147. /// <para>[To be supplied.]</para>
  148. /// </devdoc>
  149. public XmlNodeType NodeType {
  150. get { return xmlNode.NodeType; }
  151. }
  152. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.Name"]/*' />
  153. /// <devdoc>
  154. /// <para>[To be supplied.]</para>
  155. /// </devdoc>
  156. public string Name {
  157. get { return xmlNode.Name; }
  158. }
  159. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.LocalName"]/*' />
  160. /// <devdoc>
  161. /// <para>[To be supplied.]</para>
  162. /// </devdoc>
  163. public string LocalName {
  164. get { return xmlNode.LocalName; }
  165. }
  166. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.NamespaceURI"]/*' />
  167. /// <devdoc>
  168. /// <para>[To be supplied.]</para>
  169. /// </devdoc>
  170. public string NamespaceURI {
  171. get { return xmlNode.NamespaceURI; }
  172. }
  173. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.Text"]/*' />
  174. /// <devdoc>
  175. /// <para>[To be supplied.]</para>
  176. /// </devdoc>
  177. public string Text {
  178. get { return xmlNode.Value; }
  179. }
  180. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.LineNumber"]/*' />
  181. /// <devdoc>
  182. /// <para>
  183. /// Gets the current line number.
  184. /// </para>
  185. /// </devdoc>
  186. public int LineNumber {
  187. get { return lineNumber; }
  188. }
  189. /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.LinePosition"]/*' />
  190. /// <devdoc>
  191. /// <para>
  192. /// Gets the current line position.
  193. /// </para>
  194. /// </devdoc>
  195. public int LinePosition {
  196. get { return linePosition; }
  197. }
  198. }
  199. /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventHandler"]/*' />
  200. public delegate void UnreferencedObjectEventHandler(object sender, UnreferencedObjectEventArgs e);
  201. /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs"]/*' />
  202. public class UnreferencedObjectEventArgs : EventArgs {
  203. object o;
  204. string id;
  205. /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs.UnreferencedObjectEventArgs"]/*' />
  206. public UnreferencedObjectEventArgs(object o, string id) {
  207. this.o = o;
  208. this.id = id;
  209. }
  210. /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs.UnreferencedObject"]/*' />
  211. public object UnreferencedObject {
  212. get { return o; }
  213. }
  214. /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs.UnreferencedId"]/*' />
  215. public string UnreferencedId {
  216. get { return id; }
  217. }
  218. }
  219. }