1 //------------------------------------------------------------------------------
2 // <copyright file="XmlAttributeOverrides.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System.Xml.Serialization {
9 using System.Reflection;
10 using System.Collections;
12 using System.Xml.Schema;
14 using System.ComponentModel;
16 /// <include file='doc\XmlAttributeOverrides.uex' path='docs/doc[@for="XmlAttributeOverrides"]/*' />
18 /// <para>[To be supplied.]</para>
20 public class XmlAttributeOverrides {
21 Hashtable types = new Hashtable();
23 /// <include file='doc\XmlAttributeOverrides.uex' path='docs/doc[@for="XmlAttributeOverrides.Add"]/*' />
25 /// <para>[To be supplied.]</para>
27 public void Add(Type type, XmlAttributes attributes) {
28 Add(type, string.Empty, attributes);
31 /// <include file='doc\XmlAttributeOverrides.uex' path='docs/doc[@for="XmlAttributeOverrides.Add1"]/*' />
33 /// <para>[To be supplied.]</para>
35 public void Add(Type type, string member, XmlAttributes attributes) {
36 Hashtable members = (Hashtable)types[type];
37 if (members == null) {
38 members = new Hashtable();
39 types.Add(type, members);
41 else if (members[member] != null) {
42 throw new InvalidOperationException(Res.GetString(Res.XmlAttributeSetAgain, type.FullName, member));
44 members.Add(member, attributes);
47 /// <include file='doc\XmlAttributeOverrides.uex' path='docs/doc[@for="XmlAttributeOverrides.this"]/*' />
49 /// <para>[To be supplied.]</para>
51 public XmlAttributes this[Type type] {
53 return this[type, string.Empty];
57 /// <include file='doc\XmlAttributeOverrides.uex' path='docs/doc[@for="XmlAttributeOverrides.this1"]/*' />
59 /// <para>[To be supplied.]</para>
61 public XmlAttributes this[Type type, string member] {
63 Hashtable members = (Hashtable)types[type];
64 if (members == null) return null;
65 return (XmlAttributes)members[member];