public virtual void Delete() { while (AllAlbumTagUsages.Any()) { AllAlbumTagUsages.First().Delete(); } while (AllArtistTagUsages.Any()) { AllArtistTagUsages.First().Delete(); } while (AllSongTagUsages.Any()) { AllSongTagUsages.First().Delete(); } foreach (var child in AllChildren) { child.Parent = null; } while (RelatedTags.Any()) { RelatedTags.First().Delete(); } if (Parent != null) { Parent.AllChildren.Remove(this); } TagsForUsers.Clear(); }
private async void tags_relatedTagsButton_Click(object sender, EventArgs e) { RelatedTags api = new RelatedTags() { ApiKey = apiKey }; api.Arguments.tag_names = "monetary+aggregates;weekly"; if (fredValidationButton.Checked) { api.Arguments.Validators.Clear(); } TagContainer container = syncButton.Checked ? api.Fetch() : await api.FetchAsync(); ShowResults(api); }
public virtual RelatedTag AddRelatedTag(Tag tag) { ParamIs.NotNull(() => tag); if (Equals(tag)) { throw new ArgumentException("Cannot add self as related tag"); } var link = new RelatedTag(this, tag); RelatedTags.Add(link); var reverseLink = link.CreateReversed(); tag.RelatedTags.Add(reverseLink); return(link); }