private void Handler_RemovePage(object sender, EventArgs eevent) { MultiPaneControl aCtl = DesignedControl; if (aCtl == null) { return; } else if (aCtl.Controls.Count < 1) { return; } IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (aHost == null) { return; } myInTransaction = true; DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlRemovePage", new TransactionAwareParammedMethod(Transaction_RemovePage), null ); myInTransaction = false; }
private void Handler_SwitchPage(object theSender, EventArgs theArgs) { frmSwitchPages aForm = new frmSwitchPages(this); DialogResult aRes = aForm.ShowDialog(); if (aRes != DialogResult.OK) { return; } if (aForm.SetSelectedPage) { IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (aHost != null) { DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlSetSelectedPageAsConcrete", new TransactionAwareParammedMethod(Transaction_SetSelectedPageAsConcrete), aForm.FutureSelection ); } } else { DesignerSelectedPage = aForm.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; } myInTransaction = true; DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlAddPage", new TransactionAwareParammedMethod(Transaction_AddPage), null ); myInTransaction = false; }
private void Handler_ComponentRemoving(object theSender, ComponentEventArgs theArgs) { if (!(theArgs.Component is MultiPanePage)) { return; } MultiPaneControl aCtl = DesignedControl; MultiPanePage aPg = (MultiPanePage)theArgs.Component; if (!aCtl.Controls.Contains(aPg)) { return; } IDesignerHost aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (!myInTransaction) { myInTransaction = true; DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlRemoveComponent", new TransactionAwareParammedMethod(Transaction_UpdateSelectedPage), null ); myInTransaction = false; } else { Transaction_UpdateSelectedPage(aHost, null); } CheckVerbStatus(); }