static CompositionContainer CreateCompositionContainer(ExportProvider defaultExportProvider) { var catalog = new LoggingCatalog( GetCatalog(typeof(DialogService).Assembly), // GitHub.App GetCatalog(typeof(GraphQLClientFactory).Assembly), // GitHub.Api GetCatalog(typeof(RepositoryCloneView).Assembly), // GitHub.VisualStudio.UI GetCatalog(typeof(GitHubPackage).Assembly), // GitHub.VisualStudio GetCatalog(typeof(VSGitServices).Assembly), // GitHub.TeamFoundation.16 GetCatalog(typeof(GitService).Assembly), // GitHub.Exports GetCatalog(typeof(NotificationDispatcher).Assembly), // GitHub.Exports.Reactive GetCatalog(typeof(IOperatingSystem).Assembly) // Rothko ); var compositionContainer = new CompositionContainer(catalog, defaultExportProvider); var gitHubServiceProvider = new MyGitHubServiceProvider(compositionContainer); compositionContainer.ComposeExportedValue <IGitHubServiceProvider>(gitHubServiceProvider); Services.UnitTestServiceProvider = gitHubServiceProvider; // Use gitHubServiceProvider as global provider var loginManager = LoginManagerFactory.CreateLoginManager(compositionContainer); compositionContainer.ComposeExportedValue(loginManager); // Ensure GitHub.Resources.dll has been loaded and it visible to XAML EnsureLoaded(typeof(GitHub.Resources)); return(compositionContainer); }
static CompositionContainer CreateCompositionContainer(ExportProvider defaultExportProvider) { var catalog = new LoggingCatalog( GetCatalog(typeof(DialogService).Assembly), // GitHub.App GetCatalog(typeof(GraphQLClientFactory).Assembly), // GitHub.Api GetCatalog(typeof(RepositoryCloneView).Assembly), // GitHub.VisualStudio.UI GetCatalog(typeof(GitHubPackage).Assembly), // GitHub.VisualStudio GetCatalog(typeof(VSGitServices).Assembly), // GitHub.TeamFoundation.16 GetCatalog(typeof(GitService).Assembly), // GitHub.Exports GetCatalog(typeof(NotificationDispatcher).Assembly), // GitHub.Exports.Reactive GetCatalog(typeof(IOperatingSystem).Assembly) // Rothko ); var compositionContainer = new CompositionContainer(catalog, defaultExportProvider); var gitHubServiceProvider = new MyGitHubServiceProvider(compositionContainer); compositionContainer.ComposeExportedValue <IGitHubServiceProvider>(gitHubServiceProvider); var loginManager = CreateLoginManager(compositionContainer); compositionContainer.ComposeExportedValue <ILoginManager>(loginManager); // HACK: Stop ViewLocator from attempting to fetch a global service var viewViewModelFactory = compositionContainer.GetExportedValue <IViewViewModelFactory>(); InitializeViewLocator(viewViewModelFactory); return(compositionContainer); }