public bool RemoveTag(string tag) { Tag element; if (!this.tags.TryGetValue(tag, out element)) { return(false); } this.panel.Children.Remove(element); this.tags.Remove(tag); this.controller?.RemoveTag(tag); if (this.orderedTags.Count > 0 && this.orderedTags.Peek() == tag) { this.orderedTags.Pop(); } element.Dispose(); if (tags.Count == 0) { this.SetEmptyText(); } TagRemoved?.Invoke(this, tag); return(true); }
public void RemoveTag(TagAnnotation tag) { Undo.RecordObject(m_Asset, $"Remove {TagAttribute.GetDescription(tag.Type)} tag"); tags.RemoveAll(x => x == tag); tag.Dispose(); TagRemoved?.Invoke(tag); NotifyChanged(); }
private void RaiseTagRemoved(TagItem tag) { UpdateSelectedTagsOnRemove(tag); Debug.WriteLine($"RaiseTagRemoved: {tag.Text}"); TagRemoved?.Invoke(this, new TagEventArgs(tag)); }