Example #1
0
        private void Handler_AddPage(object theSender, EventArgs theArgs)
        {
            IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));

            if (service != null)
            {
                this.myInTransaction = true;
                DesignerTransactionUtility.DoInTransaction(service, "MultiPaneControlAddPage", new TransactionAwareParammedMethod(this.Transaction_AddPage), null);
                this.myInTransaction = false;
            }
        }
Example #2
0
        private void Handler_RemovePage(object sender, EventArgs eevent)
        {
            MultiPaneControl designedControl = this.DesignedControl;

            if ((designedControl != null) && (designedControl.Controls.Count >= 1))
            {
                IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));
                if (service != null)
                {
                    this.myInTransaction = true;
                    DesignerTransactionUtility.DoInTransaction(service, "MultiPaneControlRemovePage", new TransactionAwareParammedMethod(this.Transaction_RemovePage), null);
                    this.myInTransaction = false;
                }
            }
        }
Example #3
0
        private void Handler_SwitchPage(object theSender, EventArgs theArgs)
        {
            frmSwitchPages pages = new frmSwitchPages(this);

            if (pages.ShowDialog() == DialogResult.OK)
            {
                if (pages.SetSelectedPage)
                {
                    IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));
                    if (service != null)
                    {
                        DesignerTransactionUtility.DoInTransaction(service, "MultiPaneControlSetSelectedPageAsConcrete", new TransactionAwareParammedMethod(this.Transaction_SetSelectedPageAsConcrete), pages.FutureSelection);
                    }
                }
                else
                {
                    this.DesignerSelectedPage = pages.FutureSelection;
                }
            }
        }
Example #4
0
 private void Handler_ComponentRemoving(object theSender, ComponentEventArgs theArgs)
 {
     if (theArgs.Component is MultiPanePage)
     {
         MultiPaneControl designedControl = this.DesignedControl;
         MultiPanePage    component       = (MultiPanePage)theArgs.Component;
         if (designedControl.Controls.Contains(component))
         {
             IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));
             if (!this.myInTransaction)
             {
                 this.myInTransaction = true;
                 DesignerTransactionUtility.DoInTransaction(service, "MultiPaneControlRemoveComponent", new TransactionAwareParammedMethod(this.Transaction_UpdateSelectedPage), null);
                 this.myInTransaction = false;
             }
             else
             {
                 this.Transaction_UpdateSelectedPage(service, null);
             }
             this.CheckVerbStatus();
         }
     }
 }
Example #5
0
 protected override IComponent[] CreateComponentsCore(IDesignerHost theHost)
 {
     return(DesignerTransactionUtility.DoInTransaction(theHost, "MultiPaneControlTooblxItem_CreateControl", new TransactionAwareParammedMethod(this.CreateControlWithOnePage), null) as IComponent[]);
 }