Ejemplo n.º 1
0
        private void New()
        {
            //CloseCategory();
            if (!_categoryChange)
            {
                NewCategoryForm frmNewCategory = null;
                try
                {
                    frmNewCategory = new NewCategoryForm();
                    if (frmNewCategory.ShowDialog() == DialogResult.OK)
                    {
                        LiveCategory category = NewLiveCategory(frmNewCategory.CategoryName);
                        AddTabPage(NewTabPage(category));

                        if (OnCategoryCreated != null)
                        {
                            CategoryEventArgs args = new CategoryEventArgs();
                            args.Category = category;
                            OnCategoryCreated(this, args);
                        }
                    }
                }
                finally
                {
                    frmNewCategory.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
 private void AddRemoveTabPage(LiveCategory category)
 {
     if (OnCategoryCheckedStateChange != null)
     {
         CategoryEventArgs args = new CategoryEventArgs();
         args.Category = category;
         OnCategoryCheckedStateChange(this, args);
     }
 }
Ejemplo n.º 3
0
        private void tabPageControl_CloseButtonClick(object sender, EventArgs e)
        {
            if (tabPageControl.SelectedTabPage != null)
            {
                if (OnTabPageClosed != null)
                {
                    CategoryEventArgs categoryArgs = new CategoryEventArgs();
                    categoryArgs.Category = tabPageControl.SelectedTabPage.Tag as LiveCategory;
                    categoryArgs.Category.CheckedState = false;
                    OnTabPageClosed(this, categoryArgs);
                }

                tabPageControl.TabPages.Remove(tabPageControl.SelectedTabPage);
            }
        }
Ejemplo n.º 4
0
 private void ctlCategories_OnCategoryCreated(object sender, CategoryEventArgs e)
 {
     ctlLibrary.AddCategoryToGrid(new LiveCategory[] { e.Category });
 }
Ejemplo n.º 5
0
 private void ctlLibrary_OnCategoryCheckedStateChange(object sender, CategoryEventArgs e)
 {
     ctlCategories.AddRemoveCategory(e.Category);
 }
Ejemplo n.º 6
0
 private void ctlCategories_OnTabPageClosed(object sender, CategoryEventArgs e)
 {
     ctlLibrary.SetCategoryShowState(e.Category);
 }