The Labs \ Source Viewer \ SSCLI \ System.Xml.Serialization \ XmlNodeEventArgs

  1. //------------------------------------------------------------------------------
  2. // <copyright file="_Events.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. // <owner current="true" primary="true">ElenaK</owner>
  15. //------------------------------------------------------------------------------
  16. namespace System.Xml.Serialization
  17. {
  18.    
  19.     using System.IO;
  20.     using System;
  21.     using System.Collections;
  22.     using System.ComponentModel;
  23.    
  24.     /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventHandler"]/*' />
  25.     /// <devdoc>
  26.     /// <para>[To be supplied.]</para>
  27.     /// </devdoc>
  28.     public delegate void XmlAttributeEventHandler(object sender, XmlAttributeEventArgs e);
  29.    
  30.     /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs"]/*' />
  31.     /// <devdoc>
  32.     /// <para>[To be supplied.]</para>
  33.     /// </devdoc>
  34.     public class XmlAttributeEventArgs : EventArgs
  35.     {
  36.         object o;
  37.         XmlAttribute attr;
  38.         string qnames;
  39.         int lineNumber;
  40.         int linePosition;
  41.        
  42.        
  43.         internal XmlAttributeEventArgs(XmlAttribute attr, int lineNumber, int linePosition, object o, string qnames)
  44.         {
  45.             this.attr = attr;
  46.             this.o = o;
  47.             this.qnames = qnames;
  48.             this.lineNumber = lineNumber;
  49.             this.linePosition = linePosition;
  50.         }
  51.        
  52.        
  53.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.ObjectBeingDeserialized"]/*' />
  54.         /// <devdoc>
  55.         /// <para>[To be supplied.]</para>
  56.         /// </devdoc>
  57.         public object ObjectBeingDeserialized {
  58.             get { return o; }
  59.         }
  60.        
  61.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.Attr"]/*' />
  62.         /// <devdoc>
  63.         /// <para>[To be supplied.]</para>
  64.         /// </devdoc>
  65.         public XmlAttribute Attr {
  66.             get { return attr; }
  67.         }
  68.        
  69.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.LineNumber"]/*' />
  70.         /// <devdoc>
  71.         /// <para>
  72.         /// Gets the current line number.
  73.         /// </para>
  74.         /// </devdoc>
  75.         public int LineNumber {
  76.             get { return lineNumber; }
  77.         }
  78.        
  79.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.LinePosition"]/*' />
  80.         /// <devdoc>
  81.         /// <para>
  82.         /// Gets the current line position.
  83.         /// </para>
  84.         /// </devdoc>
  85.         public int LinePosition {
  86.             get { return linePosition; }
  87.         }
  88.        
  89.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.Attributes"]/*' />
  90.         /// <devdoc>
  91.         /// <para>
  92.         /// List the qnames of attributes expected in the current context.
  93.         /// </para>
  94.         /// </devdoc>
  95.         public string ExpectedAttributes {
  96.             get { return qnames == null ? string.Empty : qnames; }
  97.         }
  98.     }
  99.    
  100.     /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventHandler"]/*' />
  101.     public delegate void XmlElementEventHandler(object sender, XmlElementEventArgs e);
  102.    
  103.     /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs"]/*' />
  104.     public class XmlElementEventArgs : EventArgs
  105.     {
  106.         object o;
  107.         XmlElement elem;
  108.         string qnames;
  109.         int lineNumber;
  110.         int linePosition;
  111.        
  112.         internal XmlElementEventArgs(XmlElement elem, int lineNumber, int linePosition, object o, string qnames)
  113.         {
  114.             this.elem = elem;
  115.             this.o = o;
  116.             this.qnames = qnames;
  117.             this.lineNumber = lineNumber;
  118.             this.linePosition = linePosition;
  119.         }
  120.        
  121.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.ObjectBeingDeserialized"]/*' />
  122.         public object ObjectBeingDeserialized {
  123.             get { return o; }
  124.         }
  125.        
  126.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.Attr"]/*' />
  127.         public XmlElement Element {
  128.             get { return elem; }
  129.         }
  130.        
  131.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.LineNumber"]/*' />
  132.         public int LineNumber {
  133.             get { return lineNumber; }
  134.         }
  135.        
  136.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlElementEventArgs.LinePosition"]/*' />
  137.         public int LinePosition {
  138.             get { return linePosition; }
  139.         }
  140.        
  141.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlAttributeEventArgs.ExpectedElements"]/*' />
  142.         /// <devdoc>
  143.         /// <para>
  144.         /// List of qnames of elements expected in the current context.
  145.         /// </para>
  146.         /// </devdoc>
  147.         public string ExpectedElements {
  148.             get { return qnames == null ? string.Empty : qnames; }
  149.         }
  150.     }
  151.    
  152.     /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventHandler"]/*' />
  153.     /// <devdoc>
  154.     /// <para>[To be supplied.]</para>
  155.     /// </devdoc>
  156.     public delegate void XmlNodeEventHandler(object sender, XmlNodeEventArgs e);
  157.    
  158.     /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs"]/*' />
  159.     /// <devdoc>
  160.     /// <para>[To be supplied.]</para>
  161.     /// </devdoc>
  162.     public class XmlNodeEventArgs : EventArgs
  163.     {
  164.         object o;
  165.         XmlNode xmlNode;
  166.         int lineNumber;
  167.         int linePosition;
  168.        
  169.        
  170.         internal XmlNodeEventArgs(XmlNode xmlNode, int lineNumber, int linePosition, object o)
  171.         {
  172.             this.o = o;
  173.             this.xmlNode = xmlNode;
  174.             this.lineNumber = lineNumber;
  175.             this.linePosition = linePosition;
  176.         }
  177.        
  178.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.ObjectBeingDeserialized"]/*' />
  179.         /// <devdoc>
  180.         /// <para>[To be supplied.]</para>
  181.         /// </devdoc>
  182.         public object ObjectBeingDeserialized {
  183.             get { return o; }
  184.         }
  185.        
  186.        
  187.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.NodeType"]/*' />
  188.         /// <devdoc>
  189.         /// <para>[To be supplied.]</para>
  190.         /// </devdoc>
  191.         public XmlNodeType NodeType {
  192.             get { return xmlNode.NodeType; }
  193.         }
  194.        
  195.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.Name"]/*' />
  196.         /// <devdoc>
  197.         /// <para>[To be supplied.]</para>
  198.         /// </devdoc>
  199.         public string Name {
  200.             get { return xmlNode.Name; }
  201.         }
  202.        
  203.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.LocalName"]/*' />
  204.         /// <devdoc>
  205.         /// <para>[To be supplied.]</para>
  206.         /// </devdoc>
  207.         public string LocalName {
  208.             get { return xmlNode.LocalName; }
  209.         }
  210.        
  211.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.NamespaceURI"]/*' />
  212.         /// <devdoc>
  213.         /// <para>[To be supplied.]</para>
  214.         /// </devdoc>
  215.         public string NamespaceURI {
  216.             get { return xmlNode.NamespaceURI; }
  217.         }
  218.        
  219.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.Text"]/*' />
  220.         /// <devdoc>
  221.         /// <para>[To be supplied.]</para>
  222.         /// </devdoc>
  223.         public string Text {
  224.             get { return xmlNode.Value; }
  225.         }
  226.        
  227.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.LineNumber"]/*' />
  228.         /// <devdoc>
  229.         /// <para>
  230.         /// Gets the current line number.
  231.         /// </para>
  232.         /// </devdoc>
  233.         public int LineNumber {
  234.             get { return lineNumber; }
  235.         }
  236.        
  237.         /// <include file='doc\_Events.uex' path='docs/doc[@for="XmlNodeEventArgs.LinePosition"]/*' />
  238.         /// <devdoc>
  239.         /// <para>
  240.         /// Gets the current line position.
  241.         /// </para>
  242.         /// </devdoc>
  243.         public int LinePosition {
  244.             get { return linePosition; }
  245.         }
  246.     }
  247.    
  248.     /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventHandler"]/*' />
  249.     public delegate void UnreferencedObjectEventHandler(object sender, UnreferencedObjectEventArgs e);
  250.    
  251.     /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs"]/*' />
  252.     public class UnreferencedObjectEventArgs : EventArgs
  253.     {
  254.         object o;
  255.         string id;
  256.        
  257.         /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs.UnreferencedObjectEventArgs"]/*' />
  258.         public UnreferencedObjectEventArgs(object o, string id)
  259.         {
  260.             this.o = o;
  261.             this.id = id;
  262.         }
  263.        
  264.         /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs.UnreferencedObject"]/*' />
  265.         public object UnreferencedObject {
  266.             get { return o; }
  267.         }
  268.        
  269.         /// <include file='doc\_Events.uex' path='docs/doc[@for="UnreferencedObjectEventArgs.UnreferencedId"]/*' />
  270.         public string UnreferencedId {
  271.             get { return id; }
  272.         }
  273.     }
  274. }

Developer Fusion