AcUtils
A high performance abstraction layer for AccuRev
DomainCollection.cs
Go to the documentation of this file.
1 
16 using System;
17 using System.Configuration;
18 
19 namespace AcUtils
20 {
24 
46  [ConfigurationCollection(typeof(DomainElement),
47  CollectionType=ConfigurationElementCollectionType.AddRemoveClearMap)]
48  [Serializable]
49  public sealed class DomainCollection : ConfigurationElementCollection
50  {
51  private static ConfigurationPropertyCollection _properties;
52  static DomainCollection()
53  {
54  _properties = new ConfigurationPropertyCollection();
55  }
56 
57  public DomainCollection() { }
58 
59  protected override ConfigurationPropertyCollection Properties
60  {
61  get { return _properties; }
62  }
63 
64  public override ConfigurationElementCollectionType CollectionType
65  {
66  get { return ConfigurationElementCollectionType.AddRemoveClearMap; }
67  }
68 
69  public DomainElement this[int index]
70  {
71  get { return (DomainElement)base.BaseGet(index); }
72  set
73  {
74  if (base.BaseGet(index) != null)
75  {
76  base.BaseRemoveAt(index);
77  }
78  base.BaseAdd(index, value);
79  }
80  }
81 
82  new public DomainElement this[string key]
83  {
84  get
85  {
86  return (DomainElement)BaseGet(key);
87  }
88  }
89 
90  protected override ConfigurationElement CreateNewElement()
91  {
92  return new DomainElement();
93  }
94 
95  protected override object GetElementKey(ConfigurationElement element)
96  {
97  return (element as DomainElement).Host;
98  }
99  }
100 }
An Active Directory domain element host-path pair from .exe.config.
The list of Active Directory domain host-path pairs from .exe.config.