private void CreateRepository(int key, Type contentType) { var scope = containerGetter.Invoke().OpenScope(key); var hostRegionManager = scope.Resolve <IRegionManager>(); var taskPanesFactory = new TaskPanesFactory( windowKey: key, ctpFactory: ctpFactory, hostRegionManager: hostRegionManager, taskPaneWindow: taskPaneWindowGetter.Invoke(), contentType: contentType); var configurationsRepository = scope.Resolve <TaskPaneSettingsRepository>(); var repository = new TaskPanesRepository( key: key, scope: scope, taskPanesFactory: taskPanesFactory, configurationsRepository: configurationsRepository, documentHashGetter: taskPaneIdentifierGetter); repositories.Add( key: key, value: repository); DryIocProvider.OnScopeOpened(scope); repository.Initialise(); DryIocProvider.OnScopeInitialized(scope); }
private static void CloseRepository(TaskPanesRepository repository) { repository?.Save(); DryIocProvider.OnScopeClosing(repository?.Scope as IResolverContext); }