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