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); }
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); }
public void RemoveTagFromActiveCategory(Button tagButton) { TagData tagToDelete = WallpaperData.TaggingInfo.GetTag(ActiveCategory, tagButton.Text.Substring(0, tagButton.Text.LastIndexOf('(') - 1)); RemoveTag(tagToDelete, tagButton); }
public static Button GetTagButton(TagData tag) { CategoryData tagCategory = WallpaperData.TaggingInfo.GetCategory(tag.ParentCategoryName); return(GetCategoryTagContainer(tagCategory, ActiveTagTabControl)?.GetTagButton(tag)); }
public static void UpdateTagButton(Button tagButton, TagData tag) { tagButton.Text = tag.Name + " (" + tag.GetLinkedImageCount() + ")"; tagButton.ForeColor = tag.Enabled ? Color.Black : Color.Red; }
public CategoryData GetTagParentCategory(TagData tag) { return(GetCategory(tag.ParentCategoryName)); }
public void RemoveTag(TagData tag) { tag.ClearTag(); GetTagParentCategory(tag).Tags.Remove(tag); }
// Tags public void AddTag(TagData tag) { GetTagParentCategory(tag).Tags.Add(tag); }