Example #1
0
        private Button CreateTagButton(TagData tag)
        {
            Button tagButton = new Button();

            tagButton.AutoSize  = true;
            tagButton.BackColor = SystemColors.ButtonFace;
            TaggingTools.UpdateTagButton(tagButton, tag);

            ApplyTagFormStyle(ref tagButton);

            foreach (Control control in tagContainerFLP.Controls)
            {
                Button curTagButton = control as Button;
                if (tagButton.Text == curTagButton.Text) // this button already exists
                {
                    return(curTagButton);
                }
            }

            tagContainerFLP.Controls.Add(tagButton);
            tagContainerFLP.Controls.SetChildIndex(tagButton, orderedTags.IndexOf(tag));

            return(tagButton);
        }
Example #2
0
        public TagClickerForm(int startingTabIndex, TagFormStyle tagFormStyle, WallpaperData.ImageData activeImage = null, TagData activeTag = null, Action <TagData> tagClickEvent = null)
        {
            InitializeComponent();

            tagTabControl = new TagTabControl(startingTabIndex, tagFormStyle, activeImage, activeTag, tagClickEvent: tagClickEvent);

            //this.Size = tagTabControl.Size;
            Controls.Add(tagTabControl);
            tagTabControl.Location = new Point(0, 0);
        }
Example #3
0
        public void RemoveTagFromActiveCategory(Button tagButton)
        {
            TagData tagToDelete = WallpaperData.TaggingInfo.GetTag(ActiveCategory, tagButton.Text.Substring(0, tagButton.Text.LastIndexOf('(') - 1));

            RemoveTag(tagToDelete, tagButton);
        }
Example #4
0
        public static Button GetTagButton(TagData tag)
        {
            CategoryData tagCategory = WallpaperData.TaggingInfo.GetCategory(tag.ParentCategoryName);

            return(GetCategoryTagContainer(tagCategory, ActiveTagTabControl)?.GetTagButton(tag));
        }
Example #5
0
 public static void UpdateTagButton(Button tagButton, TagData tag)
 {
     tagButton.Text      = tag.Name + " (" + tag.GetLinkedImageCount() + ")";
     tagButton.ForeColor = tag.Enabled ? Color.Black : Color.Red;
 }
Example #6
0
 public CategoryData GetTagParentCategory(TagData tag)
 {
     return(GetCategory(tag.ParentCategoryName));
 }
Example #7
0
 public void RemoveTag(TagData tag)
 {
     tag.ClearTag();
     GetTagParentCategory(tag).Tags.Remove(tag);
 }
Example #8
0
 // Tags
 public void AddTag(TagData tag)
 {
     GetTagParentCategory(tag).Tags.Add(tag);
 }