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