Add MIT license to System.XML.DLL
[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                 public XmlSchemaObjectCollection(XmlSchemaObject parent)\r
40                 {\r
41                         this.parent = parent;\r
42                 }\r
43 \r
44                 // Properties\r
45                 public virtual XmlSchemaObject this[ int index ] \r
46                 {  \r
47                         get\r
48                         {\r
49                                 return (XmlSchemaObject) this.List[index];\r
50                         } \r
51                         set\r
52                         {\r
53                                 this.List[index] = value;\r
54                         }\r
55                 }\r
56 \r
57                 // Methods\r
58                 public int  Add(XmlSchemaObject item)\r
59                 {\r
60                         return this.List.Add(item);\r
61                 }\r
62                 \r
63                 public bool Contains(XmlSchemaObject item)\r
64                 {\r
65                         return this.List.Contains(item);\r
66                 }\r
67                 \r
68                 public void CopyTo(XmlSchemaObject[] array, int index)\r
69                 {\r
70                         this.List.CopyTo(array,index);\r
71                 }\r
72                 \r
73                 public new XmlSchemaObjectEnumerator GetEnumerator ()\r
74                 {\r
75                         return new XmlSchemaObjectEnumerator(this.List);\r
76                 }\r
77                 \r
78                 public int IndexOf(XmlSchemaObject item)\r
79                 {\r
80                         return this.List.IndexOf(item);\r
81                 }\r
82                 \r
83                 public void Insert(int index, XmlSchemaObject item)\r
84                 {\r
85                         this.List.Insert(index, item);\r
86                 }\r
87                 \r
88                 protected override void OnClear()\r
89                 {\r
90                 }\r
91 \r
92                 protected override void OnInsert(int index,object item)\r
93                 {\r
94                 }\r
95 \r
96                 protected override void OnRemove(int index,object item)\r
97                 {\r
98                 }\r
99 \r
100                 protected override void OnSet(int index,object oldValue,object newValue)\r
101                 {\r
102                 }\r
103 \r
104                 public void Remove(XmlSchemaObject item)\r
105                 {\r
106                         this.List.Remove(item);\r
107                 }\r
108         }\r
109 }\r