/
XmlFormatExtensionAttribute.cs
48 lines (38 loc) · 1.94 KB
/
XmlFormatExtensionAttribute.cs
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Web.Services.Configuration
{
[AttributeUsage(AttributeTargets.Class)]
public sealed class XmlFormatExtensionAttribute : Attribute {
private Type[] _types;
private string _name;
private string _ns;
public XmlFormatExtensionAttribute() {
}
public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1) : this(elementName, ns, new Type[] { extensionPoint1 }) {
}
public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1, Type extensionPoint2) : this(elementName, ns, new Type[] { extensionPoint1, extensionPoint2 }) {
}
public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3) : this(elementName, ns, new Type[] { extensionPoint1, extensionPoint2, extensionPoint3 }) {
}
public XmlFormatExtensionAttribute(string elementName, string ns, Type extensionPoint1, Type extensionPoint2, Type extensionPoint3, Type extensionPoint4) : this(elementName, ns, new Type[] { extensionPoint1, extensionPoint2, extensionPoint3, extensionPoint4 }) {
}
public XmlFormatExtensionAttribute(string elementName, string ns, Type[] extensionPoints) {
_name = elementName;
_ns = ns;
_types = extensionPoints;
}
public Type[] ExtensionPoints {
get { return _types == null ? new Type[0] : _types; }
set { _types = value; }
}
public string Namespace {
get { return _ns == null ? string.Empty : _ns; }
set { _ns = value; }
}
public string ElementName {
get { return _name == null ? string.Empty : _name; }
set { _name = value; }
}
}
}