public override bool TryGetValue(string key, out object value) { using (IEnumerator <GeometryAttribute> enumerator = this.Where <GeometryAttribute>((Func <GeometryAttribute, bool>)(tag => tag.Key == key)).GetEnumerator()) { if (enumerator.MoveNext()) { GeometryAttribute current = enumerator.Current; value = current.Value; return(true); } } value = (object)string.Empty; return(false); }
/// <summary> /// Adds a new attribute (key-value pair) to this attributes collection. /// </summary> /// <param name="key"></param> /// <param name="value"></param> public override void AddOrReplace(string key, object value) { for (int idx = 0; idx < _attributes.Count; idx++) { GeometryAttribute attribute = _attributes[idx]; if (attribute.Key == key) { attribute.Value = value; _attributes[idx] = attribute; return; } } this.Add(key, value); }
public override void AddOrReplace(string key, object value) { for (int index = 0; index < this._attributes.Count; ++index) { GeometryAttribute attribute = this._attributes[index]; if (attribute.Key == key) { attribute.Value = value; this._attributes[index] = attribute; return; } } this.Add(key, value); }
/// <summary> /// Adds a new attribute to this collection. /// </summary> /// <param name="attribute"></param> public override void Add(GeometryAttribute attribute) { _attributes.Add(attribute); }
/// <summary> /// Adds a new tag to this collection. /// </summary> /// <param name="tag"></param> public override void AddOrReplace(GeometryAttribute tag) { this.AddOrReplace(tag.Key, tag.Value); }