Exemplo n.º 1
0
        public static TagContainer GetCategoryTagContainer(CategoryData category, TagTabControl tagTabControl)
        {
            TagContainer categoryTagContainer = null;

            foreach (TabPage tabPage in tagTabControl.TabPages)
            {
                if (tabPage.Text == category.Name)
                {
                    if (tabPage.Controls.Count > 0) // otherwise, the TagContainer does not yet exist and needs to be created
                    {
                        categoryTagContainer = tabPage.Controls[0] as TagContainer;
                    }

                    break;
                }
            }

            return(categoryTagContainer);
        }
Exemplo n.º 2
0
        private void SwapTabPages(TabPage srcTab, TabPage dstTab)
        {
            int          srcIndex    = tabControlImageTagger.TabPages.IndexOf(srcTab);
            int          dstIndex    = tabControlImageTagger.TabPages.IndexOf(dstTab);
            CategoryData srcCategory = WallpaperData.TaggingInfo.GetCategory(srcIndex);
            CategoryData dstCategory = WallpaperData.TaggingInfo.GetCategory(dstIndex);

            tabControlImageTagger.TabPages[dstIndex] = srcTab;
            tabControlImageTagger.TabPages[srcIndex] = dstTab;
            WallpaperData.TaggingInfo.SetCategory(dstIndex, srcCategory);
            WallpaperData.TaggingInfo.SetCategory(srcIndex, dstCategory);

            if (tabControlImageTagger.SelectedIndex == srcIndex)
            {
                tabControlImageTagger.SelectedIndex = dstIndex;
            }
            else if (tabControlImageTagger.SelectedIndex == dstIndex)
            {
                tabControlImageTagger.SelectedIndex = srcIndex;
            }

            tabControlImageTagger.Refresh();
        }
Exemplo n.º 3
0
 public void RemoveCategory(CategoryData category)
 {
     RemoveCategory(WallpaperData.TaggingInfo.GetCategoryIndex(category));
 }
Exemplo n.º 4
0
 public bool CreateCategory(CategoryData category)
 {
     //!TaggingTools.GetCategoryTagContainer(category, this) = null; // needs to be refreshed for a number of reasons such as: Resetting events & reloading disposed objects
     return(CreateCategory(category.Name, category.Tags, category.Enabled, category.UseForNaming));
 }
Exemplo n.º 5
0
        public static Button GetTagButton(TagData tag)
        {
            CategoryData tagCategory = WallpaperData.TaggingInfo.GetCategory(tag.ParentCategoryName);

            return(GetCategoryTagContainer(tagCategory, ActiveTagTabControl)?.GetTagButton(tag));
        }
Exemplo n.º 6
0
 public bool ContainsCategory(CategoryData category)
 {
     return(ContainsCategory(category.Name));
 }
Exemplo n.º 7
0
 public void SetCategory(int index, CategoryData category)
 {
     CategoryInfo[index] = category;
 }
Exemplo n.º 8
0
 public int GetCategoryIndex(CategoryData category)
 {
     return(CategoryInfo.IndexOf(category));
 }