예제 #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);
     }
 }
예제 #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)));
 }
예제 #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)));
 }