public void CloseCurrentTab() { //nothing to close if (Navigation.Current == null) { return; } Navigation.Suspend(); try { Navigation.Current.Close(); if (Navigation.Current != null) { Navigation.Current.Activate(ActivateItems); } } finally { Navigation.Resume(); if (_mainDockPanel.ActiveDocument is DockContent dc) { Navigation.Append(new TabNavigation(dc)); } } }
void mainDockPanel_ActiveDocumentChanged(object sender, EventArgs e) { var newTab = (DockContent)_mainDockPanel.ActiveDocument; Navigation.Append(newTab); if (newTab != null && newTab.ParentForm != null) { newTab.ParentForm.Text = newTab.TabText + " - RDMP"; } if (TabChanged != null) { TabChanged(sender, newTab); } }
public void CloseCurrentTab() { //nothing to close if (Navigation.CurrentTab == null) { return; } Navigation.Suspend(); try { Navigation.CurrentTab.Close(); if (Navigation.CurrentTab != null) { Navigation.CurrentTab.Activate(); } } finally { Navigation.Resume(); Navigation.Append(_mainDockPanel.ActiveDocument as DockContent); } }
/// <summary> /// Creates a new instance of the given RDMPCollectionUI specified by the Enum collectionToCreate at the specified dock position /// </summary> /// <param name="collectionToCreate"></param> /// <param name="position"></param> /// <returns></returns> public PersistableToolboxDockContent Create(RDMPCollection collectionToCreate, DockState position = DockState.DockLeft) { PersistableToolboxDockContent toReturn; RDMPCollectionUI collection; switch (collectionToCreate) { case RDMPCollection.Catalogue: collection = new CatalogueCollectionUI(); toReturn = Show(RDMPCollection.Catalogue, collection, "Catalogues", CatalogueIcons.Catalogue); break; case RDMPCollection.DataLoad: collection = new LoadMetadataCollectionUI(); toReturn = Show(RDMPCollection.DataLoad, collection, "Load Configurations", CatalogueIcons.LoadMetadata); break; case RDMPCollection.Tables: collection = new TableInfoCollectionUI(); toReturn = Show(RDMPCollection.Tables, collection, "Tables", CatalogueIcons.TableInfo); break; case RDMPCollection.DataExport: if (RepositoryLocator.DataExportRepository == null) { WideMessageBox.Show("Data export database unavailable", "Cannot create DataExport Toolbox because DataExportRepository has not been set/created yet"); return(null); } collection = new DataExportCollectionUI(); toReturn = Show(RDMPCollection.DataExport, collection, "Data Export", CatalogueIcons.Project); break; case RDMPCollection.Cohort: collection = new CohortIdentificationCollectionUI(); toReturn = Show(RDMPCollection.Cohort, collection, "Cohort Builder", CatalogueIcons.CohortIdentificationConfiguration); break; case RDMPCollection.SavedCohorts: collection = new SavedCohortsCollectionUI(); toReturn = Show(RDMPCollection.SavedCohorts, collection, "Saved Cohorts", CatalogueIcons.AllCohortsNode); break; case RDMPCollection.Favourites: collection = new FavouritesCollectionUI(); toReturn = Show(RDMPCollection.Favourites, collection, "Favourites", CatalogueIcons.Favourite); break; default: throw new ArgumentOutOfRangeException("collectionToCreate"); } toReturn.DockState = position; collection.SetItemActivator(ActivateItems); if (CollectionCreated != null) { CollectionCreated(this, new RDMPCollectionCreatedEventHandlerArgs(collectionToCreate)); } collection.CommonTreeFunctionality.Tree.SelectionChanged += (s, e) => { if (collection.CommonTreeFunctionality.Tree.SelectedObject is IMapsDirectlyToDatabaseTable im) { Navigation.Append(new CollectionNavigation(im)); } }; return(toReturn); }
private void RecordEmphasis(object sender, EmphasiseEventArgs args) { Navigation.Append(new CollectionNavigation(args.Request.ObjectToEmphasise)); }