/// <summary> /// Gets the value of a tag -or- null if there are no tags with the specified name. /// </summary> /// <param name="name">Name of the desired tag value.</param> public string GetTag(string name) { AccountTag tag = Tags.FirstOrDefault(t => t.Name == name); if (tag != null) { return(tag.Value); } return(null); }
/// <summary> /// Gets the value of a tag -or- null if there are no tags with the specified name. /// </summary> /// <param name="name">Name of the desired tag value.</param> public string GetTag( string name ) { for ( int i = 0; i < Tags.Count; ++i ) { AccountTag tag = Tags[i]; if ( tag.Name == name ) return tag.Value; } return null; }
/// <summary> /// Modifies an existing tag or adds a new tag if no tag exists. /// </summary> /// <param name="name">Tag name.</param> /// <param name="value">Tag value.</param> public void SetTag(string name, string value) { AccountTag tag = Tags.FirstOrDefault(t => t.Name == name); if (tag != null) { tag.Value = value; return; } AddTag(name, value); }
/// <summary> /// Removes all tags with the specified name from this account. /// </summary> /// <param name="name">Tag name to remove.</param> public void RemoveTag( string name ) { for ( int i = Tags.Count - 1; i >= 0; --i ) { if ( i >= Tags.Count ) continue; AccountTag tag = Tags[i]; if ( tag.Name == name ) Tags.RemoveAt( i ); } }
/// <summary> /// Gets the value of a tag -or- null if there are no tags with the specified name. /// </summary> /// <param name="name">Name of the desired tag value.</param> public string GetTag(string name) { for (int i = 0; i < Tags.Count; ++i) { AccountTag tag = Tags[i]; if (tag.Name == name) { return(tag.Value); } } return(null); }
/// <summary> /// Modifies an existing tag or adds a new tag if no tag exists. /// </summary> /// <param name="name">Tag name.</param> /// <param name="value">Tag value.</param> public void SetTag(string name, string value) { for (int i = 0; i < Tags.Count; ++i) { AccountTag tag = Tags[i]; if (tag.Name == name) { tag.Value = value; return; } } AddTag(name, value); }
/// <summary> /// Removes all tags with the specified name from this account. /// </summary> /// <param name="name">Tag name to remove.</param> public void RemoveTag(string name) { for (int i = this.Tags.Count - 1; i >= 0; --i) { if (i >= this.Tags.Count) { continue; } AccountTag tag = this.Tags[i]; if (tag.Name == name) { this.Tags.RemoveAt(i); } } }
/// <summary> /// Gets the value of a tag -or- null if there are no tags with the specified name. /// </summary> /// <param name="name">Name of the desired tag value.</param> public string GetTag(string name) { if (m_Tags == null) { return(null); } for (int i = 0; i < m_Tags.Count; ++i) { AccountTag tag = (AccountTag)m_Tags[i]; if (tag.Name == name) { return(tag.Value); } } return(null); }
/// <summary> /// Modifies an existing tag or adds a new tag if no tag exists. /// </summary> /// <param name="name">Tag name.</param> /// <param name="value">Tag value.</param> public void SetTag(string name, string value) { if (m_Tags == null) { m_Tags = new ArrayList(4); } for (int i = 0; i < m_Tags.Count; ++i) { AccountTag tag = (AccountTag)m_Tags[i]; if (tag.Name == name) { tag.Value = value; return; } } AddTag(name, value); }
/// <summary> /// Removes all tags with the specified name from this account. /// </summary> /// <param name="name">Tag name to remove.</param> public void RemoveTag(string name) { if (m_Tags == null) { return; } for (int i = m_Tags.Count - 1; i >= 0; --i) { if (i >= m_Tags.Count) { continue; } AccountTag tag = (AccountTag)m_Tags[i]; if (tag.Name == name) { m_Tags.RemoveAt(i); } } }