コード例 #1
0
ファイル: ImageSelection.cs プロジェクト: radtek/epresenter
        private void btnLink_Click(object sender, EventArgs e)
        {
            if (ppiCurrent == null)
            {
                return;
            }

            AssignToCategory f = new AssignToCategory(ppiCurrent.PhotoInfo.ImageId, false);

            if (f.ShowDialog() == DialogResult.OK)
            {
                // Check if the current image got removed from the current category
                System.Collections.Hashtable h = PhotoInfo.GetCatListById(ppiCurrent.PhotoInfo.ImageId);
                if (!(bool)h[photoPreviewContainer1.CurrentCategory])
                {
                    photoPreviewContainer1.Controls.Remove(ppiCurrent);
                }

                // Check if category list needs to be refreshed
                if (f.needCategoryRefresh)
                {
                    supressCatChanged = true;
                    object selectedItem = _categories.SelectedItem;
                    InternalLoadCategories();
                    _categories.SelectedItem = selectedItem;
                    supressCatChanged        = false;
                }
            }
        }
コード例 #2
0
 private void BuildCategoryList()
 {
     _categories.Items.Clear();
     categories = PhotoInfo.GetCatListById(imageId);
     foreach (string cat in categories.Keys)
     {
         if (cat == "All")
         {
             continue; // Do not allow the user to remove the image from the built in "All" category
         }
         _categories.Items.Add(cat, (bool)categories[cat]);
     }
 }