Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }