Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / Serialization / XmlAnyElementAttribute.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XmlAnyElementAttribute.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">[....]</owner>                                                                
6 //------------------------------------------------------------------------------
7
8 namespace System.Xml.Serialization {
9     using System;
10     using System.Xml.Schema;
11
12     /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute"]/*' />
13     /// <devdoc>
14     ///    <para>[To be supplied.]</para>
15     /// </devdoc>
16     [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=true)]
17     public class XmlAnyElementAttribute : System.Attribute {
18         string name;
19         string ns;
20         int order = -1;
21         bool nsSpecified = false;
22
23         /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.XmlAnyElementAttribute"]/*' />
24         /// <devdoc>
25         ///    <para>[To be supplied.]</para>
26         /// </devdoc>
27         public XmlAnyElementAttribute() {
28         }
29         
30         /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.XmlAnyElementAttribute1"]/*' />
31         /// <devdoc>
32         ///    <para>[To be supplied.]</para>
33         /// </devdoc>
34         public XmlAnyElementAttribute(string name) {
35             this.name = name;
36         }
37
38         /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.XmlAnyElementAttribute2"]/*' />
39         /// <devdoc>
40         ///    <para>[To be supplied.]</para>
41         /// </devdoc>
42         public XmlAnyElementAttribute(string name, string ns) {
43             this.name = name;
44             this.ns = ns;
45             nsSpecified = true;
46         }
47         
48         /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.Name"]/*' />
49         /// <devdoc>
50         ///    <para>[To be supplied.]</para>
51         /// </devdoc>
52         public string Name {
53             get { return name == null ? string.Empty : name; }
54             set { name = value; }
55         }
56         
57         /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.Namespace"]/*' />
58         /// <devdoc>
59         ///    <para>[To be supplied.]</para>
60         /// </devdoc>
61         public string Namespace {
62             get { return ns; }
63             set { 
64                 ns = value; 
65                 nsSpecified = true;
66             }
67         }
68
69         /// <include file='doc\XmlAnyElementAttribute.uex' path='docs/doc[@for="XmlAnyElementAttribute.Order"]/*' />
70         /// <devdoc>
71         ///    <para>[To be supplied.]</para>
72         /// </devdoc>
73         public int Order {
74             get { return order; }
75             set {
76                 if (value < 0)
77                     throw new ArgumentException(Res.GetString(Res.XmlDisallowNegativeValues), "Order");
78                 order = value;
79             }
80         }
81
82         internal bool NamespaceSpecified {
83             get { return nsSpecified; }
84         }
85     }
86 }