Пример #1
0
 /// <summary>
 /// Registers a scope in the internal dictionary.
 /// </summary>
 /// <param name="name">The name of the scope.</param>
 /// <param name="description">The description of the scope.</param>
 public static SlackScope RegisterScope(string name, string description) {
     if (Lookup.ContainsKey(name)) throw new ArgumentException("A scope with the specified name \"" + name + "\" has already been registered.", "name");
     SlackScope scope = new SlackScope(name, description);
     Lookup.Add(scope.Name, scope);
     return scope;
 }
Пример #2
0
 /// <summary>
 /// Registers a scope in the internal dictionary.
 /// </summary>
 /// <param name="scope">The scope to be registered.</param>
 public static SlackScope RegisterScope(SlackScope scope) {
     if (scope == null) throw new ArgumentNullException("scope");
     if (Lookup.ContainsKey(scope.Name)) throw new ArgumentException("A scope with the specified name has already been registered.", "scope");
     Lookup.Add(scope.Name, scope);
     return scope;
 }
 /// <summary>
 /// Adds the specified <code>scope</code> to the collection.
 /// </summary>
 /// <param name="scope">The scope to be added.</param>
 public void Add(SlackScope scope) {
     _list.Add(scope);
 }