private void Handler_RemovePage(object sender, EventArgs eevent) { MultiPaneControl aCtl = DesignedControl; if (aCtl == null) { return; } else if (aCtl.Controls.Count < 1) { return; } var aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (aHost == null) { return; } myInTransaction = true; DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlRemovePage", Transaction_RemovePage, null ); myInTransaction = false; }
private void Handler_SwitchPage(object theSender, EventArgs theArgs) { var aForm = new frmSwitchPages(this); DialogResult aRes = aForm.ShowDialog(); if (aRes != DialogResult.OK) { return; } if (aForm.SetSelectedPage) { var aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (aHost != null) { DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlSetSelectedPageAsConcrete", Transaction_SetSelectedPageAsConcrete, aForm.FutureSelection ); } } else { DesignerSelectedPage = aForm.FutureSelection; } }
protected override IComponent[] CreateComponentsCore(IDesignerHost theHost) { return(DesignerTransactionUtility.DoInTransaction ( theHost, "MultiPaneControlTooblxItem_CreateControl", CreateControlWithOnePage, null ) as IComponent[]); }
private void Handler_AddPage(object theSender, EventArgs theArgs) { var aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (aHost == null) { return; } myInTransaction = true; DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlAddPage", Transaction_AddPage, null ); myInTransaction = false; }
private void Handler_ComponentRemoving(object theSender, ComponentEventArgs theArgs) { if (!(theArgs.Component is MultiPanePage)) { return; } MultiPaneControl aCtl = DesignedControl; var aPg = (MultiPanePage)theArgs.Component; if (!aCtl.Controls.Contains(aPg)) { return; } var aHost = (IDesignerHost)GetService(typeof(IDesignerHost)); if (!myInTransaction) { myInTransaction = true; DesignerTransactionUtility.DoInTransaction ( aHost, "MultiPaneControlRemoveComponent", Transaction_UpdateSelectedPage, null ); myInTransaction = false; } else { Transaction_UpdateSelectedPage(aHost, null); } CheckVerbStatus(); }