2 // XmlAnyElementAttributes.cs:
5 // John Donagher (john@webmeta.com)
7 // (C) 2002 John Donagher
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
32 using System.Collections.Generic;
34 namespace System.Xml.Serialization
37 /// Summary description for XmlAnyElementAttributes.
40 public class XmlAnyElementAttributes : IList {
42 private List<XmlAnyElementAttribute> List = new List<XmlAnyElementAttribute> ();
44 int IList.Add (object value)
46 return (List as IList).Add (value);
54 bool IList.Contains (object value)
56 return (List as IList).Contains (value);
59 int IList.IndexOf (object value)
61 return (List as IList).IndexOf (value);
64 void IList.Insert (int index, object value)
66 (List as IList).Insert (index, value);
69 bool IList.IsFixedSize {
70 get { return (List as IList).IsFixedSize; }
73 bool IList.IsReadOnly {
74 get { return (List as IList).IsReadOnly; }
77 void IList.Remove (object value)
79 (List as IList).Remove (value);
82 void IList.RemoveAt (int index)
84 List.RemoveAt (index);
87 object IList.this [int index] {
88 get { return (List as IList) [index]; }
89 set { (List as IList) [index] = value; }
92 void ICollection.CopyTo (Array array, int index)
94 (List as ICollection).CopyTo (array, index);
98 get { return List.Count; }
101 bool ICollection.IsSynchronized {
102 get { return (List as ICollection).IsSynchronized; }
105 object ICollection.SyncRoot {
106 get { return (List as ICollection).SyncRoot; }
109 IEnumerator IEnumerable.GetEnumerator ()
111 return (List as IEnumerable).GetEnumerator ();
114 public class XmlAnyElementAttributes : CollectionBase {
117 public XmlAnyElementAttribute this[int index]
121 return (XmlAnyElementAttribute)List[index];
129 public int Add(XmlAnyElementAttribute attribute)
131 return (List as IList).Add (attribute);
134 public bool Contains(XmlAnyElementAttribute attribute)
136 return List.Contains(attribute);
139 public int IndexOf(XmlAnyElementAttribute attribute)
141 return List.IndexOf(attribute);
144 public void Insert(int index, XmlAnyElementAttribute attribute)
146 List.Insert(index, attribute);
149 public void Remove(XmlAnyElementAttribute attribute)
151 List.Remove(attribute);
154 public void CopyTo(XmlAnyElementAttribute[] array,int index)
156 List.CopyTo(array, index);
159 internal void AddKeyHash (System.Text.StringBuilder sb)
161 if (Count == 0) return;
163 sb.Append ("XAEAS ");
164 for (int n=0; n<Count; n++)
165 this[n].AddKeyHash (sb);
171 foreach (XmlAnyElementAttribute e in this)