Add mono dependencies
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / Serialization / Configuration / SchemaImporterExtensionElementCollection.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="SchemaImporterExtensionElementCollection.cs" company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">[....]</owner>                                                                
6 //------------------------------------------------------------------------------
7 #if CONFIGURATION_DEP
8 namespace System.Xml.Serialization.Configuration
9 {
10
11     using System;
12     using System.Configuration;
13     using System.Security.Permissions;
14
15     [ConfigurationCollection(typeof(SchemaImporterExtensionElement))]
16     public sealed class SchemaImporterExtensionElementCollection : ConfigurationElementCollection
17     {
18         public SchemaImporterExtensionElementCollection() 
19         {
20         }
21         
22         public SchemaImporterExtensionElement this[int index]
23         {
24             get
25             {
26                 return (SchemaImporterExtensionElement)BaseGet(index);
27             }
28             set
29             {
30                 if (BaseGet(index) != null)
31                 {
32                     BaseRemoveAt(index);
33                 }
34                 BaseAdd(index,value);
35             }
36         }
37          
38         public new SchemaImporterExtensionElement this[string name]
39         {
40             get
41             {
42                 return (SchemaImporterExtensionElement)BaseGet(name);
43             }
44             set
45             {
46                 if (BaseGet(name) != null)
47                 {
48                     BaseRemove(name);
49                 }
50                 BaseAdd(value);
51             }
52         }
53          
54         public void Add(SchemaImporterExtensionElement element)
55         {
56             BaseAdd(element);
57         }
58
59         public void Clear()
60         {
61             BaseClear();
62         }
63
64         protected override ConfigurationElement CreateNewElement() 
65         {
66             return new SchemaImporterExtensionElement();
67         }
68
69         protected override Object GetElementKey(ConfigurationElement element) 
70         {
71             return ((SchemaImporterExtensionElement)element).Key;
72         }
73
74         public int IndexOf(SchemaImporterExtensionElement element)
75         {
76             return BaseIndexOf(element);
77         }
78          
79         public void Remove(SchemaImporterExtensionElement element) 
80         {
81             BaseRemove(element.Key);
82         }
83
84         public void Remove(string name) 
85         {
86             BaseRemove(name);
87         }
88
89         public void RemoveAt(int index)
90         {
91             BaseRemoveAt(index);
92         }
93
94     } 
95
96 }
97
98 #endif