mscorlib(4.0.0.0) API with additions
XmlAttributeOverrides.cs
1 using System.Collections;
2 
4 {
6  [global::__DynamicallyInvokable]
7  public class XmlAttributeOverrides
8  {
9  private Hashtable types = new Hashtable();
10 
14  [global::__DynamicallyInvokable]
15  public XmlAttributes this[Type type]
16  {
17  [global::__DynamicallyInvokable]
18  get
19  {
20  return this[type, string.Empty];
21  }
22  }
23 
28  [global::__DynamicallyInvokable]
29  public XmlAttributes this[Type type, string member]
30  {
31  [global::__DynamicallyInvokable]
32  get
33  {
34  Hashtable hashtable = (Hashtable)types[type];
35  if (hashtable == null)
36  {
37  return null;
38  }
39  return (XmlAttributes)hashtable[member];
40  }
41  }
42 
46  [global::__DynamicallyInvokable]
47  public void Add(Type type, XmlAttributes attributes)
48  {
49  Add(type, string.Empty, attributes);
50  }
51 
56  [global::__DynamicallyInvokable]
57  public void Add(Type type, string member, XmlAttributes attributes)
58  {
59  Hashtable hashtable = (Hashtable)types[type];
60  if (hashtable == null)
61  {
62  hashtable = new Hashtable();
63  types.Add(type, hashtable);
64  }
65  else if (hashtable[member] != null)
66  {
67  throw new InvalidOperationException(Res.GetString("XmlAttributeSetAgain", type.FullName, member));
68  }
69  hashtable.Add(member, attributes);
70  }
71 
73  [global::__DynamicallyInvokable]
75  {
76  }
77  }
78 }
void Add(Type type, XmlAttributes attributes)
Adds an T:System.Xml.Serialization.XmlAttributes object to the collection of T:System....
virtual void Add(object key, object value)
Adds an element with the specified key and value into the T:System.Collections.Hashtable.
Definition: Hashtable.cs:916
abstract string FullName
Gets the fully qualified name of the type, including its namespace but not its assembly.
Definition: Type.cs:153
Definition: __Canon.cs:3
XmlAttributeOverrides()
Initializes a new instance of the T:System.Xml.Serialization.XmlAttributeOverrides class.
Represents a collection of key/value pairs that are organized based on the hash code of the key....
Definition: Hashtable.cs:17
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
Represents a collection of attribute objects that control how the T:System.Xml.Serialization....
Definition: XmlAttributes.cs:8
void Add(Type type, string member, XmlAttributes attributes)
Adds an T:System.Xml.Serialization.XmlAttributes object to the collection of T:System....
The exception that is thrown when a method call is invalid for the object's current state.
Allows you to override property, field, and class attributes when you use the T:System....