Ejemplo n.º 1
0
        internal async Task OnProjectChangedAsync(IProjectVersionedValue <IProjectSubscriptionUpdate>?_ = null)
        {
            bool isDebuggable = await _launchProviders.Value.IsDebuggableAsync();

            IVsStartupProjectsListService startupProjectsListService = await _startupProjectsListService.GetValueAsync();

            if (isDebuggable)
            {
                // If we're already registered, the service no-ops
                startupProjectsListService.AddProject(ref _projectGuid);
            }
            else
            {
                // If we're already unregistered, the service no-ops
                startupProjectsListService.RemoveProject(ref _projectGuid);
            }
        }
        private async Task AddOrRemoveProjectFromStartupProjectList(bool initialize = false)
        {
            bool isDebuggable = await IsDebuggable().ConfigureAwait(false);

            await _threadingService.SwitchToUIThread();

            _startupProjectsListService = _startupProjectsListService ?? _serviceProvider.GetService <IVsStartupProjectsListService, SVsStartupProjectsListService>();
            if (initialize || isDebuggable != _isDebuggable)
            {
                _isDebuggable = isDebuggable;
                if (isDebuggable)
                {
                    _startupProjectsListService.AddProject(ref _guid);
                }
                else
                {
                    _startupProjectsListService.RemoveProject(ref _guid);
                }
            }
        }
Ejemplo n.º 3
0
        internal Task OnProjectChangedAsync(IProjectVersionedValue <IProjectSubscriptionUpdate>?_ = null)
        {
            return(_projectTasksService.LoadedProjectAsync(async() =>
            {
                bool isDebuggable = await IsDebuggableAsync();

                IVsStartupProjectsListService startupProjectsListService = await _startupProjectsListService.GetValueAsync();

                if (isDebuggable)
                {
                    // If we're already registered, the service no-ops
                    startupProjectsListService.AddProject(ref _projectGuid);
                }
                else
                {
                    // If we're already unregistered, the service no-ops
                    startupProjectsListService.RemoveProject(ref _projectGuid);
                }
            }));
        }