예제 #1
0
        /// <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);
        }
예제 #2
0
		/// <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;
		}
예제 #3
0
        /// <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);
        }
예제 #4
0
		/// <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 );
			}
		}
예제 #5
0
        /// <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);
        }
예제 #6
0
        /// <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);
        }
예제 #7
0
        /// <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);
                }
            }
        }
예제 #8
0
        /// <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);
        }
예제 #9
0
        /// <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);
        }
예제 #10
0
        /// <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);
                }
            }
        }