Example #1
0
 /// <summary>
 /// Internal utility to register the attribute.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="attribute"></param>
 private void InternalRegister(string name, Attribute attribute)
 {
     if (_attributesMap.ContainsKey(name))
     {
         throw new ArgumentException($"Duplicate name {name}", nameof(name));
     }
     _attributesMap[name]           = attribute;
     _attributesIdMap[attribute.Id] = attribute;
 }
Example #2
0
 /// <summary>
 /// Register an attribute with a specified name.
 /// </summary>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="name"></param>
 /// <param name="attribute"></param>
 public void Register <TValue>(string name, Attribute <TValue> attribute)
 {
     InternalRegister(name, attribute);
 }
Example #3
0
 /// <summary>
 /// Register an attribute with a specified name.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="attribute"></param>
 /// <exception cref="ArgumentException">When the attribute name already exists</exception>
 public void Register(string name, Attribute attribute)
 {
     InternalRegister(name, attribute);
 }