コード例 #1
0
        private void Cm_Click(object sender, EventArgs e)
        {
            var page = _kctxmenuTabItem.Tag as KryptonPage;

            _kctxmenuTabItem.Tag = null;
            if (page == null)
            {
                return;
            }

            var index = TabOperator.getPageIndex(page, _knavTab);

            if (index == -1)
            {
                return;
            }
            var model = TabOperator.getTabItemModel(page);

            var cm  = sender as KryptonContextMenuItem;
            var tag = cm.Tag + "";

            switch (tag)
            {
            case "reload":

                break;

            case "collection":

                break;

            case "insertBefore":
                TabOperator.insert(newModel(), _knavTab, index);
                break;

            case "insertAfter":
                index = index + 1 >= _knavTab.Pages.Count ? -1 : index + 1;
                TabOperator.insert(newModel(), _knavTab, index);
                break;

            case "close":
                TabOperator.remove(model, _knavTab);
                break;

            case "closeOther":
                TabOperator.removeOther(page.UniqueName, _knavTab);
                break;

            case "closeLeft":
                TabOperator.removeLeft(page.UniqueName, _knavTab);
                break;

            case "closeRight":
                TabOperator.removeRight(page.UniqueName, _knavTab);
                break;

            case "closeAll":
                TabOperator.removeAll(_knavTab);
                break;

            case "exit":
                Application.Exit();
                break;
            }
        }
コード例 #2
0
        private void BtnspecAdd_Click(object sender, EventArgs e)
        {
            KryptonPage page = TabOperator.insert(newModel(), _knavTab);

            _knavTab.SelectedPage = page;
        }