Ejemplo n.º 1
0
        private StartupProjectRegistrar CreateInstance(
            UnconfiguredProject project           = null,
            IAsyncServiceProvider serviceProvider = null,
            IVsStartupProjectsListService vsStartupProjectsListService = null,
            IProjectThreadingService threadingService = null,
            IProjectGuidService2 projectGuidService   = null,
            IActiveConfiguredProjectSubscriptionService projectSubscriptionService = null,
            ActiveConfiguredProject <DebuggerLaunchProviders> launchProviders      = null)
        {
            if (serviceProvider == null)
            {
                var sp = new IAsyncServiceProviderMoq();
                sp.AddService(typeof(SVsStartupProjectsListService), vsStartupProjectsListService ?? IVsStartupProjectsListServiceFactory.Create());
                serviceProvider = sp;
            }

            var instance = new StartupProjectRegistrar(
                project ?? UnconfiguredProjectFactory.Create(),
                serviceProvider,
                threadingService ?? new IProjectThreadingServiceMock(),
                projectSubscriptionService ?? IActiveConfiguredProjectSubscriptionServiceFactory.Create(),
                launchProviders);

            if (projectGuidService != null)
            {
                instance.ProjectGuidServices.Add((IProjectGuidService)projectGuidService);
            }

            return(instance);
        }
Ejemplo n.º 2
0
        private StartupProjectRegistrar CreateInstance(
            IVsStartupProjectsListService vsStartupProjectsListService = null,
            IProjectThreadingService threadingService  = null,
            ISafeProjectGuidService projectGuidService = null,
            IActiveConfiguredProjectSubscriptionService projectSubscriptionService = null,
            ActiveConfiguredProject <DebuggerLaunchProviders> launchProviders      = null)
        {
            var instance = new StartupProjectRegistrar(
                null,
                IVsServiceFactory.Create <SVsStartupProjectsListService, IVsStartupProjectsListService>(vsStartupProjectsListService),
                threadingService ?? IProjectThreadingServiceFactory.Create(),
                projectGuidService ?? ISafeProjectGuidServiceFactory.ImplementGetProjectGuidAsync(Guid.NewGuid()),
                projectSubscriptionService ?? IActiveConfiguredProjectSubscriptionServiceFactory.Create(),
                launchProviders);

            return(instance);
        }