public void RemoveTag(string dead_tag_bundle) { bool notify; lock (access_lock) { notify = doc.RemoveTag(dead_tag_bundle); } if (notify) { Bindable.NotifyPropertyChanged(nameof(Tags)); TagManager.Instance.ProcessDocument(this); } }
public void AddTag(string new_tag_bundle) { HashSet <string> new_tags = TagTools.ConvertTagBundleToTags(new_tag_bundle); HashSet <string> tags = TagTools.ConvertTagBundleToTags(Tags); int tag_count_old = tags.Count; tags.UnionWith(new_tags); int tag_count_new = tags.Count; // Update listeners if we changed anything if (tag_count_old != tag_count_new) { Tags = TagTools.ConvertTagListToTagBundle(tags); Bindable.NotifyPropertyChanged(() => Tags); TagManager.Instance.ProcessDocument(this); } }
public void RemoveTag(string dead_tag_bundle) { HashSet <string> dead_tags = TagTools.ConvertTagBundleToTags(dead_tag_bundle); HashSet <string> tags = TagTools.ConvertTagBundleToTags(Tags); int tag_count_old = tags.Count; foreach (string dead_tag in dead_tags) { tags.Remove(dead_tag); } int tag_count_new = tags.Count; if (tag_count_old != tag_count_new) { Tags = TagTools.ConvertTagListToTagBundle(tags); Bindable.NotifyPropertyChanged(() => Tags); TagManager.Instance.ProcessDocument(this); } }