2006-08-26 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaObjectCollection.cs
1 // Author: Dwivedi, Ajay kumar\r
2 //            Adwiv@Yahoo.com\r
3
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining
6 // a copy of this software and associated documentation files (the
7 // "Software"), to deal in the Software without restriction, including
8 // without limitation the rights to use, copy, modify, merge, publish,
9 // distribute, sublicense, and/or sell copies of the Software, and to
10 // permit persons to whom the Software is furnished to do so, subject to
11 // the following conditions:
12 // 
13 // The above copyright notice and this permission notice shall be
14 // included in all copies or substantial portions of the Software.
15 // 
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 using System;\r
25 using System.Collections;\r
26 \r
27 namespace System.Xml.Schema\r
28 {\r
29         /// <summary>\r
30         /// Summary description for XmlSchemaObjectCollection.\r
31         /// </summary>\r
32         public class XmlSchemaObjectCollection : System.Collections.CollectionBase\r
33         {\r
34 //              private XmlSchemaObject parent;\r
35 \r
36                 public XmlSchemaObjectCollection()\r
37                 {\r
38                 }\r
39 \r
40                 public XmlSchemaObjectCollection(XmlSchemaObject parent)\r
41                 {\r
42                         // FIXME: how is it used publicly?\r
43 //                      this.parent = parent;\r
44                 }\r
45 \r
46                 // Properties\r
47                 public virtual XmlSchemaObject this[ int index ] \r
48                 {  \r
49                         get\r
50                         {\r
51                                 return (XmlSchemaObject) this.List[index];\r
52                         } \r
53                         set\r
54                         {\r
55                                 this.List[index] = value;\r
56                         }\r
57                 }\r
58 \r
59                 // Methods\r
60                 public int  Add(XmlSchemaObject item)\r
61                 {\r
62                         return this.List.Add(item);\r
63                 }\r
64                 \r
65                 public bool Contains(XmlSchemaObject item)\r
66                 {\r
67                         return this.List.Contains(item);\r
68                 }\r
69                 \r
70                 public void CopyTo(XmlSchemaObject[] array, int index)\r
71                 {\r
72                         this.List.CopyTo(array,index);\r
73                 }\r
74                 \r
75                 public new XmlSchemaObjectEnumerator GetEnumerator ()\r
76                 {\r
77                         return new XmlSchemaObjectEnumerator(this.List);\r
78                 }\r
79                 \r
80                 public int IndexOf(XmlSchemaObject item)\r
81                 {\r
82                         return this.List.IndexOf(item);\r
83                 }\r
84                 \r
85                 public void Insert(int index, XmlSchemaObject item)\r
86                 {\r
87                         this.List.Insert(index, item);\r
88                 }\r
89                 \r
90                 protected override void OnClear()\r
91                 {\r
92                 }\r
93 \r
94                 protected override void OnInsert(int index,object item)\r
95                 {\r
96                 }\r
97 \r
98                 protected override void OnRemove(int index,object item)\r
99                 {\r
100                 }\r
101 \r
102                 protected override void OnSet(int index,object oldValue,object newValue)\r
103                 {\r
104                 }\r
105 \r
106                 public void Remove(XmlSchemaObject item)\r
107                 {\r
108                         this.List.Remove(item);\r
109                 }\r
110         }\r
111 }\r