Пример #1
0
        public void buttonTag_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Unlink tag?", "Choose an option", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                Button  tagButton    = sender as Button;
                string  tagName      = TaggingTools.GetButtonTagName(tagButton);
                string  categoryName = TaggingTools.GetButtonCategoryName(tagButton);
                TagData linkedTag    = WallpaperData.TaggingInfo.GetTag(categoryName, tagName);

                foreach (Tuple <string, string> tagInfo in linkedTag.ChildTags)
                {
                    if (activeTag.ParentTags.Contains(tagInfo))
                    {
                        MessageBox.Show("You cannot unlink " + linkedTag.Name + " while it's child tag " + tagInfo.Item2 + " is also linked");
                        return;
                    }
                }

                if (MessageBox.Show("Would you like to also remove the tag " + tagName + " from images tagged with " + activeTag.Name + "?", "Choose an option", MessageBoxButtons.YesNo)
                    == DialogResult.Yes)
                {
                    foreach (string image in activeTag.GetLinkedImages())
                    {
                        WallpaperData.GetImageData(image).RemoveTag(linkedTag);
                    }
                }

                activeTag.UnlinkTag(linkedTag);
                tagButton.Dispose();
            }
        }
Пример #2
0
        public Button GetTagButton(TagData tag)
        {
            foreach (Control control in tagContainerFLP.Controls)
            {
                Button tagButton = control as Button;
                if (TaggingTools.GetButtonTagName(tagButton) == tag.Name)
                {
                    return(tagButton);
                }
            }

            return(null);
        }
Пример #3
0
        public void tagContainerButton_DragDrop(object sender, DragEventArgs e)
        {
            if (selectedButtonPotentialTabPage != null)
            {
                string selectedTag      = TaggingTools.GetButtonTagName(selectedButton);
                string selectedCategory = selectedButtonPotentialTabPage.Text;
                if (MessageBox.Show("Move " + selectedTag + " to " + selectedCategory + "?", "Choose an option", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    ParentTagForm.MoveTag(selectedTag, selectedCategory);
                }
            }

            selectedButton = null;
            selectedButtonPotentialTabPage = null;
        }
Пример #4
0
 private TagData GetSelectedTag(Button selectedTagButton)
 {
     return(WallpaperData.TaggingInfo.GetTag(ActiveCategory, TaggingTools.GetButtonTagName(selectedTagButton)));
 }
Пример #5
0
        private void ButtonTagEditor(object sender, EventArgs e)
        {
            Button  selectedTagButton = sender as Button;
            TagData selectedTag       = WallpaperData.TaggingInfo.GetTag(ActiveCategory, TaggingTools.GetButtonTagName(selectedTagButton));

            using (TagEditorForm f = new TagEditorForm(selectedTag, selectedTagButton, this.tagContainerFLP)) f.ShowDialog();
            RefreshTagCount();
        }