AcUtils
A high performance abstraction layer for AccuRev
GroupsCollection.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(GroupElement),
46  CollectionType=ConfigurationElementCollectionType.AddRemoveClearMap)]
47  [Serializable]
48  public sealed class GroupsCollection : ConfigurationElementCollection
49  {
50  private static ConfigurationPropertyCollection _properties;
51  static GroupsCollection()
52  {
53  _properties = new ConfigurationPropertyCollection();
54  }
55 
56  public GroupsCollection() { }
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 GroupElement this[int index]
69  {
70  get { return (GroupElement)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 GroupElement this[string key]
82  {
83  get { return (GroupElement)BaseGet(key); }
84  }
85 
86  protected override ConfigurationElement CreateNewElement()
87  {
88  return new GroupElement();
89  }
90 
91  protected override object GetElementKey(ConfigurationElement element)
92  {
93  return (element as GroupElement).Group;
94  }
95  }
96 }
An AccuRev group from the Groups section in .exe.config.
Definition: GroupElement.cs:25
The list of AccuRev groups from .exe.config.