示例#1
0
        /// <summary>
        /// Add tag to the list
        /// </summary>
        /// <param name="tag">tag string to add</param>
        public void AddTag(string tag)
        {
            if (string.IsNullOrEmpty(tag))
            {
                return;
            }

            TagList.Add(tag);
            var newTagLabel = new TagLabelControl(tag);

            newTagLabel.OnRemoved += OnTagLabelControlRemoved;

            Controls.Add(newTagLabel);

            OnTagListUpdated.Raise(this, null);
        }
示例#2
0
 /// <summary>
 /// Tag label removed handler
 /// </summary>
 /// <param name="control">Control to be removed</param>
 void OnTagLabelControlRemoved(TagLabelControl control)
 {
     TagList.Remove(control.TagText);
     OnTagListUpdated.Raise(this, null);
 }
示例#3
0
 /// <summary>
 /// Clear all tags
 /// </summary>
 public void ClearAllTags()
 {
     Controls.Clear();
     TagList.Clear();
     OnTagListUpdated.Raise(this, null);
 }