Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / Tools / ManagedExtensions / ManagementExtensions / Default / DomainCollection.cs
blob9e52e25e424168c5bd0dc310264eb95ab82d48d8
1 // Copyright 2003-2004 DigitalCraftsmen - http://www.digitalcraftsmen.com.br/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.ManagementExtensions.Default
17 using System;
18 using System.Collections;
19 using System.Collections.Specialized;
21 /// <summary>
22 /// Summary description for DomainCollection.
23 /// </summary>
24 public class DomainCollection : NameObjectCollectionBase, IEnumerable
26 public DomainCollection() :
27 base(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default)
31 public void Add(Domain domain)
33 lock(this)
35 base.BaseAdd(domain.Name, domain);
39 public Domain this[String domainName]
41 get
43 return base.BaseGet(domainName) as Domain;
47 public String[] ToArray()
49 lock(this)
51 String[] names = new String[base.Keys.Count];
52 int index = 0;
53 foreach(String key in base.Keys)
55 names[index++] = key;
57 return names;
61 #region IEnumerable Members
63 public new IEnumerator GetEnumerator()
65 return base.BaseGetAllValues().GetEnumerator();
68 #endregion