Welcome to mirror list, hosted at ThFree Co, Russian Federation.

XmlAttributes.cs « System.Xml.Serialization « System.XML « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58b5472c9ddb18cdb52fc041901e7f345cb8bbdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
//
// XmlAttributes.cs: 
//
// Author:
//   John Donagher (john@webmeta.com)
//
// (C) 2002 John Donagher
//

using System.Reflection;
using System;
using System.ComponentModel;

namespace System.Xml.Serialization
{
	/// <summary>
	/// Summary description for XmlAttributes.
	/// </summary>
	public class XmlAttributes
	{
		private XmlAnyAttributeAttribute xmlAnyAttribute;
		private XmlAnyElementAttributes xmlAnyElements;
		private XmlArrayAttribute xmlArray;
		private XmlArrayItemAttributes xmlArrayItems;
		private XmlAttributeAttribute xmlAttribute;
		private XmlChoiceIdentifierAttribute xmlChoiceIdentifier;
		private object xmlDefaultValue;
		private XmlElementAttributes xmlElements;
		private XmlEnumAttribute xmlEnum;
		private bool xmlIgnore;
		private bool xmlns;
		private XmlRootAttribute xmlRoot;
		private XmlTextAttribute xmlText;
		private XmlTypeAttribute xmlType;

		public XmlAttributes ()
		{
			xmlAnyElements = new XmlAnyElementAttributes ();
			xmlArrayItems = new XmlArrayItemAttributes ();
			xmlElements = new XmlElementAttributes ();
		}

		public XmlAttributes (ICustomAttributeProvider provider)
		{
			object[] attributes = provider.GetCustomAttributes(false);
			foreach(object obj in attributes)
			{
				if(obj is XmlAnyAttributeAttribute)
					xmlAnyAttribute = (XmlAnyAttributeAttribute) obj;
				else if(obj is XmlAnyElementAttributes)
					xmlAnyElements = (XmlAnyElementAttributes) obj;
				else if(obj is XmlArrayAttribute)
					xmlArray = (XmlArrayAttribute) obj;
				else if(obj is XmlArrayItemAttributes)
					xmlArrayItems = (XmlArrayItemAttributes) obj;
				else if(obj is XmlAttributeAttribute)
					xmlAttribute = (XmlAttributeAttribute) obj;
				else if(obj is XmlChoiceIdentifierAttribute)
					xmlChoiceIdentifier = (XmlChoiceIdentifierAttribute) obj;
				else if(obj is DefaultValueAttribute)
					xmlDefaultValue = obj;
				else if(obj is XmlElementAttributes)
					xmlElements = (XmlElementAttributes) obj;
				else if(obj is XmlEnumAttribute)
					xmlEnum = (XmlEnumAttribute) obj;
				else if(obj is XmlIgnoreAttribute)
					xmlIgnore = true;
				else if(obj is XmlNamespaceDeclarationsAttribute)
					xmlns = true;
				else if(obj is XmlRootAttribute)
					xmlRoot = (XmlRootAttribute) obj;
				else if(obj is XmlTextAttribute)
					xmlText = (XmlTextAttribute) obj;
				else if(obj is XmlTypeAttribute)
					xmlType = (XmlTypeAttribute) obj;
			}
		}

		public XmlAnyAttributeAttribute XmlAnyAttribute {
			get {
				return xmlAnyAttribute;
			}
			set {
				xmlAnyAttribute = value;
			}
		}
		public XmlAnyElementAttributes XmlAnyElements {
			get {
				return xmlAnyElements;
			}
		}
		public XmlArrayAttribute XmlArray {
			get {
				return xmlArray;
			}
			set {
				xmlArray = value;
			}
		}
		public XmlArrayItemAttributes XmlArrayItems {
			get {
				return xmlArrayItems;
			}
		}
		public XmlAttributeAttribute XmlAttribute {
			get {
				return xmlAttribute;
			}
			set {
				xmlAttribute = value;
			}
		}
		public XmlChoiceIdentifierAttribute XmlChoiceIdentifier {
			get {
				return xmlChoiceIdentifier;
			}
			set {
				xmlChoiceIdentifier = value;
			}
		}
		public object XmlDefaultValue {
			get {
				return xmlDefaultValue;
			}
			set {
				xmlDefaultValue = value;
			}
		}
		public XmlElementAttributes XmlElements {
			get {
				return xmlElements;
			}
		}
		public XmlEnumAttribute XmlEnum {
			get {
				return xmlEnum;
			}
			set {
				xmlEnum = value;
			}
		}
		public bool XmlIgnore {
			get {
				return xmlIgnore;
			}
			set {
				xmlIgnore = value;
			}
		}
		public bool Xmlns {
			get {
				return xmlns;
			}
			set {
				xmlns = value;
			}
		}
		public XmlRootAttribute XmlRoot {
			get {
				return xmlRoot;}
			set {
				xmlRoot = value;
			}
		}
		public XmlTextAttribute XmlText {
			get {
				return xmlText;
			}
			set {
				xmlText = value;
			}
		}
		public XmlTypeAttribute XmlType {
			get {
				return xmlType;
			}
			set {
				xmlType = value;
			}
		}
	}
}