private void UpdateChildProviders() { //prefer a linked repository with both if (RepositoryLocator.DataExportRepository != null) { try { CoreChildProvider = new DataExportChildProvider(RepositoryLocator, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier); } catch (Exception e) { ExceptionViewer.Show(e); } } //there was an error generating a data export repository or there was no repository specified //so just create a catalogue one if (CoreChildProvider == null) { CoreChildProvider = new CatalogueChildProvider(RepositoryLocator.CatalogueRepository, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier); } CoreChildProvider.GetPluginChildren(); RefreshBus.ChildProvider = CoreChildProvider; }
private void RefreshChildProvider() { //todo pass the plugin child providers if (RepositoryLocator.DataExportRepository != null) { CoreChildProvider = new DataExportChildProvider(RepositoryLocator, null, new ThrowImmediatelyCheckNotifier()); } else { CoreChildProvider = new CatalogueChildProvider(RepositoryLocator.CatalogueRepository, null, new ThrowImmediatelyCheckNotifier()); } }
public void ChildProviderGiven_TableInfoWith_NullServer() { var ti = WhenIHaveA <TableInfo>(); ti.Server = null; ti.SaveToDatabase(); //creating a child provider when there are TableInfos with null servers should not crash the API! var provider = new CatalogueChildProvider(Repository.CatalogueRepository, null, new ThrowImmediatelyCheckNotifier(), null); var desc = provider.GetDescendancyListIfAnyFor(ti); Assert.IsNotNull(desc); //instead we should get a parent node with the name "Null Server" var parent = (TableInfoServerNode)desc.Parents[desc.Parents.Length - 1]; Assert.AreEqual(TableInfoServerNode.NullServerNode, parent.ServerName); }
protected override ICoreChildProvider GetChildProvider() { //constructor call in base class if (PluginUserInterfaces == null) { return(null); } //Dispose the old one ICoreChildProvider temp = null; //prefer a linked repository with both if (RepositoryLocator.DataExportRepository != null) { try { temp = new DataExportChildProvider(RepositoryLocator, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as DataExportChildProvider); } catch (Exception e) { ExceptionViewer.Show(e); } } //there was an error generating a data export repository or there was no repository specified //so just create a catalogue one if (temp == null) { temp = new CatalogueChildProvider(RepositoryLocator.CatalogueRepository, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as CatalogueChildProvider); } // first time if (CoreChildProvider == null) { CoreChildProvider = temp; } else { CoreChildProvider.UpdateTo(temp); } return(CoreChildProvider); }
protected virtual ICoreChildProvider GetChildProvider() { // Build new CoreChildProvider in a temp then update to it to avoid stale references ICoreChildProvider temp = null; //prefer a linked repository with both if (RepositoryLocator.DataExportRepository != null) { try { temp = new DataExportChildProvider(RepositoryLocator, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as DataExportChildProvider); } catch (Exception e) { ShowException("Error constructing DataExportChildProvider", e); } } //there was an error generating a data export repository or there was no repository specified //so just create a catalogue one if (temp == null) { temp = new CatalogueChildProvider(RepositoryLocator.CatalogueRepository, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as CatalogueChildProvider); } // first time if (CoreChildProvider == null) { CoreChildProvider = temp; } else { CoreChildProvider.UpdateTo(temp); } return(CoreChildProvider); }
public CohortContainerManagerFromChildProvider(CatalogueRepository repository, CatalogueChildProvider childProvider) : base(repository) { FetchAllRelationships(childProvider); }