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