private void Handler_ComponentRemoving(object theSender, ComponentEventArgs theArgs)
        {
            if (!(theArgs.Component is Page))
            {
                return;
            }
            MultiLayerPanel aCtl = DesignedControl;
            Page            aPg  = (Page)theArgs.Component;

            if (!aCtl.Controls.Contains(aPg))
            {
                return;
            }
            IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost));

            if (!inTransaction)
            {
                inTransaction = true;
                DesignerTransactionUtility.DoInTransaction
                (
                    aHost,
                    "MultiPaneControlRemoveComponent",
                    new TransactionAwareParammedMethod(Transaction_UpdateSelectedPage),
                    null
                );
                inTransaction = false;
            }
            else
            {
                Transaction_UpdateSelectedPage(aHost, null);
            }

            CheckVerbStatus();
        }
        private void Handler_RemovePage(object sender, EventArgs eevent)
        {
            MultiLayerPanel aCtl = DesignedControl;

            if (aCtl == null)
            {
                return;
            }
            else if (aCtl.Controls.Count < 1)
            {
                return;
            }
            IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost));

            if (aHost == null)
            {
                return;
            }
            inTransaction = true;
            DesignerTransactionUtility.DoInTransaction
            (
                aHost,
                "MultiPaneControlRemovePage",
                new TransactionAwareParammedMethod(Transaction_RemovePage),
                null
            );
            inTransaction = false;
        }
        private void Handler_SwitchPage(object theSender, EventArgs theArgs)
        {
            MultiLayerPanelSwitchPages form = new MultiLayerPanelSwitchPages(this);
            DialogResult aRes = form.ShowDialog();

            if (aRes != DialogResult.OK)
            {
                return;
            }
            if (form.SetSelectedPage)
            {
                IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost));
                if (aHost != null)
                {
                    DesignerTransactionUtility.DoInTransaction
                    (
                        aHost,
                        "MultiPaneControlSetSelectedPageAsConcrete",
                        new TransactionAwareParammedMethod(Transaction_SetSelectedPageAsConcrete),
                        form.FutureSelection
                    );
                }
            }
            else
            {
                DesignerSelectedPage = form.FutureSelection;
            }
        }
 protected override IComponent[] CreateComponentsCore(IDesignerHost theHost)
 {
     return(DesignerTransactionUtility.DoInTransaction
            (
                theHost,
                "MultiPaneControlTooblxItem_CreateControl",
                new TransactionAwareParammedMethod(CreateControlWithOnePage),
                null
            ) as IComponent[]);
 }
        private void Handler_AddPage(object theSender, EventArgs theArgs)
        {
            IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost));

            if (aHost == null)
            {
                return;
            }
            inTransaction = true;
            DesignerTransactionUtility.DoInTransaction
            (
                aHost,
                "MultiPaneControlAddPage",
                new TransactionAwareParammedMethod(Transaction_AddPage),
                null
            );
            inTransaction = false;
        }