mscorlib(4.0.0.0) API with additions
XmlRootAttribute.cs
2 {
4  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.ReturnValue)]
5  [global::__DynamicallyInvokable]
6  public class XmlRootAttribute : Attribute
7  {
8  private string elementName;
9 
10  private string ns;
11 
12  private string dataType;
13 
14  private bool nullable = true;
15 
16  private bool nullableSpecified;
17 
20  [global::__DynamicallyInvokable]
21  public string ElementName
22  {
23  [global::__DynamicallyInvokable]
24  get
25  {
26  if (elementName != null)
27  {
28  return elementName;
29  }
30  return string.Empty;
31  }
32  [global::__DynamicallyInvokable]
33  set
34  {
35  elementName = value;
36  }
37  }
38 
41  [global::__DynamicallyInvokable]
42  public string Namespace
43  {
44  [global::__DynamicallyInvokable]
45  get
46  {
47  return ns;
48  }
49  [global::__DynamicallyInvokable]
50  set
51  {
52  ns = value;
53  }
54  }
55 
58  [global::__DynamicallyInvokable]
59  public string DataType
60  {
61  [global::__DynamicallyInvokable]
62  get
63  {
64  if (dataType != null)
65  {
66  return dataType;
67  }
68  return string.Empty;
69  }
70  [global::__DynamicallyInvokable]
71  set
72  {
73  dataType = value;
74  }
75  }
76 
80  [global::__DynamicallyInvokable]
81  public bool IsNullable
82  {
83  [global::__DynamicallyInvokable]
84  get
85  {
86  return nullable;
87  }
88  [global::__DynamicallyInvokable]
89  set
90  {
91  nullable = value;
92  nullableSpecified = true;
93  }
94  }
95 
96  internal bool IsNullableSpecified => nullableSpecified;
97 
98  internal string Key => ((ns == null) ? string.Empty : ns) + ":" + ElementName + ":" + nullable.ToString();
99 
101  [global::__DynamicallyInvokable]
103  {
104  }
105 
108  [global::__DynamicallyInvokable]
109  public XmlRootAttribute(string elementName)
110  {
111  this.elementName = elementName;
112  }
113  }
114 }
Represents the base class for custom attributes.
Definition: Attribute.cs:15
string DataType
Gets or sets the XSD data type of the XML root element.
XmlRootAttribute()
Initializes a new instance of the T:System.Xml.Serialization.XmlRootAttribute class.
Controls XML serialization of the attribute target as an XML root element.
XmlRootAttribute(string elementName)
Initializes a new instance of the T:System.Xml.Serialization.XmlRootAttribute class and specifies the...
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
string Namespace
Gets or sets the namespace for the XML root element.
bool IsNullable
Gets or sets a value that indicates whether the T:System.Xml.Serialization.XmlSerializer must seriali...
string ElementName
Gets or sets the name of the XML element that is generated and recognized by the T:System....