mscorlib(4.0.0.0) API with additions
XmlElementAttribute.cs
1 using System.Xml.Schema;
2 
4 {
6  [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true)]
7  [global::__DynamicallyInvokable]
9  {
10  private string elementName;
11 
12  private Type type;
13 
14  private string ns;
15 
16  private string dataType;
17 
18  private bool nullable;
19 
20  private bool nullableSpecified;
21 
22  private XmlSchemaForm form;
23 
24  private int order = -1;
25 
28  [global::__DynamicallyInvokable]
29  public Type Type
30  {
31  [global::__DynamicallyInvokable]
32  get
33  {
34  return type;
35  }
36  [global::__DynamicallyInvokable]
37  set
38  {
39  type = value;
40  }
41  }
42 
45  [global::__DynamicallyInvokable]
46  public string ElementName
47  {
48  [global::__DynamicallyInvokable]
49  get
50  {
51  if (elementName != null)
52  {
53  return elementName;
54  }
55  return string.Empty;
56  }
57  [global::__DynamicallyInvokable]
58  set
59  {
60  elementName = value;
61  }
62  }
63 
66  [global::__DynamicallyInvokable]
67  public string Namespace
68  {
69  [global::__DynamicallyInvokable]
70  get
71  {
72  return ns;
73  }
74  [global::__DynamicallyInvokable]
75  set
76  {
77  ns = value;
78  }
79  }
80 
84  [global::__DynamicallyInvokable]
85  public string DataType
86  {
87  [global::__DynamicallyInvokable]
88  get
89  {
90  if (dataType != null)
91  {
92  return dataType;
93  }
94  return string.Empty;
95  }
96  [global::__DynamicallyInvokable]
97  set
98  {
99  dataType = value;
100  }
101  }
102 
106  [global::__DynamicallyInvokable]
107  public bool IsNullable
108  {
109  [global::__DynamicallyInvokable]
110  get
111  {
112  return nullable;
113  }
114  [global::__DynamicallyInvokable]
115  set
116  {
117  nullable = value;
118  nullableSpecified = true;
119  }
120  }
121 
122  internal bool IsNullableSpecified => nullableSpecified;
123 
126  [global::__DynamicallyInvokable]
127  public XmlSchemaForm Form
128  {
129  [global::__DynamicallyInvokable]
130  get
131  {
132  return form;
133  }
134  [global::__DynamicallyInvokable]
135  set
136  {
137  form = value;
138  }
139  }
140 
143  [global::__DynamicallyInvokable]
144  public int Order
145  {
146  [global::__DynamicallyInvokable]
147  get
148  {
149  return order;
150  }
151  [global::__DynamicallyInvokable]
152  set
153  {
154  if (value < 0)
155  {
156  throw new ArgumentException(Res.GetString("XmlDisallowNegativeValues"), "Order");
157  }
158  order = value;
159  }
160  }
161 
163  [global::__DynamicallyInvokable]
165  {
166  }
167 
170  [global::__DynamicallyInvokable]
171  public XmlElementAttribute(string elementName)
172  {
173  this.elementName = elementName;
174  }
175 
178  [global::__DynamicallyInvokable]
180  {
181  this.type = type;
182  }
183 
187  [global::__DynamicallyInvokable]
188  public XmlElementAttribute(string elementName, Type type)
189  {
190  this.elementName = elementName;
191  this.type = type;
192  }
193  }
194 }
int Order
Gets or sets the explicit order in which the elements are serialized or deserialized.
string Namespace
Gets or sets the namespace assigned to the XML element that results when the class is serialized.
XmlElementAttribute(string elementName, Type type)
Initializes a new instance of the T:System.Xml.Serialization.XmlElementAttribute and specifies the na...
XmlSchemaForm
Indicates if attributes or elements need to be qualified with a namespace prefix.
Definition: XmlSchemaForm.cs:7
Represents the base class for custom attributes.
Definition: Attribute.cs:15
Definition: __Canon.cs:3
bool IsNullable
Gets or sets a value that indicates whether the T:System.Xml.Serialization.XmlSerializer must seriali...
XmlSchemaForm Form
Gets or sets a value that indicates whether the element is qualified.
string ElementName
Gets or sets the name of the generated XML element.
XmlElementAttribute()
Initializes a new instance of the T:System.Xml.Serialization.XmlElementAttribute class.
string DataType
Gets or sets the XML Schema definition (XSD) data type of the XML element generated by the T:System....
XmlElementAttribute(Type type)
Initializes a new instance of the T:System.Xml.Serialization.XmlElementAttribute class and specifies ...
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
The exception that is thrown when one of the arguments provided to a method is not valid.
Indicates that a public field or property represents an XML element when the T:System....
XmlElementAttribute(string elementName)
Initializes a new instance of the T:System.Xml.Serialization.XmlElementAttribute class and specifies ...