Ejemplo n.º 1
0
 /// <summary>
 /// Gets or sets attributes for the given id.
 /// </summary>
 public IAttributeCollection this[uint id]
 {
     get
     {
         var p = this.Search(id, out _);
         if (p == _NO_DATA)
         {
             return(null);
         }
         return(_attributes.Get(p));
     }
     set
     {
         int idx;
         var p = this.Search(id, out idx);
         if (p == _NO_DATA)
         {
             this.Add(id, _attributes.Add(value));
             return;
         }
         _data[idx + 1] = _attributes.Add(value);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a new tag collection.
 /// </summary>
 public static uint Add(this AttributesIndex index, params Attribute[] attributes)
 {
     return(index.Add(new AttributeCollection(attributes)));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a new attributes collection.
 /// </summary>
 public static uint Add(this AttributesIndex index, IEnumerable <Attribute> attributes)
 {
     return(index.Add(new AttributeCollection(attributes)));
 }