public DependenciesProjectTreeProvider(
            IProjectThreadingService threadingService,
            UnconfiguredProject project,
            IDependenciesSnapshotProvider dependenciesSnapshotProvider,
            [Import(DependencySubscriptionsHost.DependencySubscriptionsHostContract)]
            ICrossTargetSubscriptionsHost dependenciesHost,
            [Import(ExportContractNames.Scopes.UnconfiguredProject)] IProjectAsynchronousTasksService tasksService,
            IDependencyTreeTelemetryService treeTelemetryService)
            : base(threadingService, project)
        {
            ProjectTreePropertiesProviders = new OrderPrecedenceImportCollection <IProjectTreePropertiesProvider>(
                ImportOrderPrecedenceComparer.PreferenceOrder.PreferredComesLast,
                projectCapabilityCheckProvider: project);

            ViewProviders = new OrderPrecedenceImportCollection <IDependenciesTreeViewProvider>(
                ImportOrderPrecedenceComparer.PreferenceOrder.PreferredComesFirst,
                projectCapabilityCheckProvider: project);

            DependenciesSnapshotProvider = dependenciesSnapshotProvider;
            DependenciesHost             = dependenciesHost;
            TasksService          = tasksService;
            _treeTelemetryService = treeTelemetryService;

            project.ProjectUnloading += OnUnconfiguredProjectUnloading;
        }
예제 #2
0
        public DependenciesProjectTreeProvider(
            IProjectThreadingService threadingService,
            IProjectAccessor projectAccessor,
            UnconfiguredProject unconfiguredProject,
            IDependenciesSnapshotProvider dependenciesSnapshotProvider,
            [Import(DependenciesSnapshotProvider.DependencySubscriptionsHostContract)] ICrossTargetSubscriptionsHost dependenciesHost,
            [Import(ExportContractNames.Scopes.UnconfiguredProject)] IProjectAsynchronousTasksService tasksService,
            IDependencyTreeTelemetryService treeTelemetryService)
            : base(threadingService, unconfiguredProject)
        {
            _projectTreePropertiesProviders = new OrderPrecedenceImportCollection <IProjectTreePropertiesProvider>(
                ImportOrderPrecedenceComparer.PreferenceOrder.PreferredComesLast,
                projectCapabilityCheckProvider: unconfiguredProject);

            _viewProviders = new OrderPrecedenceImportCollection <IDependenciesTreeViewProvider>(
                ImportOrderPrecedenceComparer.PreferenceOrder.PreferredComesFirst,
                projectCapabilityCheckProvider: unconfiguredProject);

            _dependenciesSnapshotProvider = dependenciesSnapshotProvider;
            _dependenciesHost             = dependenciesHost;
            _tasksService         = tasksService;
            _projectAccessor      = projectAccessor;
            _treeTelemetryService = treeTelemetryService;

            // Hook this so we can unregister the snapshot change event when the project unloads
            unconfiguredProject.ProjectUnloading += OnUnconfiguredProjectUnloading;

            Task OnUnconfiguredProjectUnloading(object sender, EventArgs args)
            {
                UnconfiguredProject.ProjectUnloading -= OnUnconfiguredProjectUnloading;
                _snapshotEventListener?.Dispose();

                return(Task.CompletedTask);
            }
        }
        public Task InitializeSubscriberAsync(ICrossTargetSubscriptionsHost host, IProjectSubscriptionService subscriptionService)
        {
            _host = host;

            SubscribeToConfiguredProject(subscriptionService);

            return Task.CompletedTask;
        }
        public async Task InitializeSubscriberAsync(ICrossTargetSubscriptionsHost host, IProjectSubscriptionService subscriptionService)
        {
            _host = host;

            await InitializeAsync();

            IReadOnlyCollection <string> watchedEvaluationRules      = GetWatchedRules(RuleHandlerType.Evaluation);
            IReadOnlyCollection <string> watchedDesignTimeBuildRules = GetWatchedRules(RuleHandlerType.DesignTimeBuild);

            SubscribeToConfiguredProject(
                _commonServices.ActiveConfiguredProject, subscriptionService, watchedEvaluationRules, watchedDesignTimeBuildRules);
        }
        public async Task InitializeSubscriberAsync(ICrossTargetSubscriptionsHost host, IProjectSubscriptionService subscriptionService)
        {
            _host = host;

            await InitializeAsync().ConfigureAwait(false);

            var watchedEvaluationRules      = GetWatchedRules(RuleHandlerType.Evaluation);
            var watchedDesignTimeBuildRules = GetWatchedRules(RuleHandlerType.DesignTimeBuild);

            SubscribeToConfiguredProject(
                subscriptionService, watchedEvaluationRules, watchedDesignTimeBuildRules);
        }
        public async Task InitializeSubscriberAsync(ICrossTargetSubscriptionsHost host, IProjectSubscriptionService subscriptionService)
        {
            _host = host;

            await InitializeAsync();

            IReadOnlyCollection <string> watchedEvaluationRules = GetRuleNames(RuleSource.Evaluation);
            IReadOnlyCollection <string> watchedJointRules      = GetRuleNames(RuleSource.Joint);

            SubscribeToConfiguredProject(
                _commonServices.ActiveConfiguredProject, subscriptionService, watchedEvaluationRules, watchedJointRules);
        }
예제 #7
0
        public void InitializeSubscriber(ICrossTargetSubscriptionsHost host, IProjectSubscriptionService subscriptionService)
        {
            _host = host;

            EnsureInitialized();

            IEnumerable <string> watchedEvaluationRules      = GetWatchedRules(RuleHandlerType.Evaluation);
            IEnumerable <string> watchedDesignTimeBuildRules = GetWatchedRules(RuleHandlerType.DesignTimeBuild);

            SubscribeToConfiguredProject(
                _commonServices.ActiveConfiguredProject, subscriptionService, watchedEvaluationRules, watchedDesignTimeBuildRules);
        }
        public void InitializeSubscriber(ICrossTargetSubscriptionsHost host, IProjectSubscriptionService subscriptionService)
        {
            _host = host;

            SubscribeToConfiguredProject(subscriptionService);
        }
예제 #9
0
        public Task InitializeSubscriberAsync(ICrossTargetSubscriptionsHost host)
        {
            _host = host;

            return(InitializeAsync());
        }