public ActivateItems(ITheme theme, RefreshBus refreshBus, DockPanel mainDockPanel, IRDMPPlatformRepositoryServiceLocator repositoryLocator, WindowFactory windowFactory, WindowManager windowManager, ICheckNotifier globalErrorCheckNotifier) : base(repositoryLocator, globalErrorCheckNotifier) { Theme = theme; WindowFactory = windowFactory; _mainDockPanel = mainDockPanel; _windowManager = windowManager; RefreshBus = refreshBus; ConstructPluginChildProviders(); CoreChildProvider = GetChildProvider(); //Shouldn't ever change externally to your session so doesn't need constantly refreshed FavouritesProvider = new FavouritesProvider(this, repositoryLocator.CatalogueRepository); HistoryProvider = new HistoryProvider(repositoryLocator); //handle custom icons from plugin user interfaces in which CoreIconProvider = new DataExportIconProvider(repositoryLocator, PluginUserInterfaces.ToArray()); SelectIMapsDirectlyToDatabaseTableDialog.ImageGetter = (model) => CoreIconProvider.GetImage(model); WindowArranger = new WindowArranger(this, _windowManager, _mainDockPanel); CommandFactory = new RDMPCombineableFactory(); CommandExecutionFactory = new RDMPCommandExecutionFactory(this); ProblemProviders = new List <IProblemProvider>(); ProblemProviders.Add(new DataExportProblemProvider()); ProblemProviders.Add(new CatalogueProblemProvider()); RefreshProblemProviders(); RefreshBus.Subscribe(this); }
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); }
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; }