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