public UnconfiguredProjectTasksService([Import(ExportContractNames.Scopes.UnconfiguredProject)] IProjectAsynchronousTasksService tasksService, IProjectThreadingService threadingService, ILoadedInHostListener loadedInHostListener)
 {
     _prioritizedTaskQueue = new JoinableTaskQueue(threadingService.JoinableTaskContext);
     _tasksService         = tasksService;
     _threadingService     = threadingService;
     _loadedInHostListener = loadedInHostListener;
 }
 public ProjectOutputWindowProjectLogger(IProjectThreadingService threadingService, IProjectSystemOptions options, IProjectOutputWindowPaneProvider outputWindowProvider)
 {
     _threadingService     = threadingService;
     _options              = options;
     _outputWindowProvider = outputWindowProvider;
 }
Ejemplo n.º 3
0
#pragma warning disable CA1725 // Parameter names should match base declaration
        public void SetObjects(uint cObjects, object[] ppUnk)
#pragma warning restore CA1725 // Parameter names should match base declaration
        {
            if (cObjects == 0)
            {
                return;
            }
#if DEBUG
            if (ppUnk == null)
            {
                throw new ArgumentNullException(nameof(ppUnk));
            }

            if (ppUnk.Length < cObjects)
            {
                throw new ArgumentOutOfRangeException(nameof(cObjects));
            }
#endif
            ThreadHelper.ThrowIfNotOnUIThread();

            var configuredProjects = new List <ConfiguredProject>((int)cObjects);

            for (int i = 0; i < cObjects; i++)
            {
                var unk = ppUnk[i];

                var context = unk as IVsBrowseObjectContext;

                if (context == null && unk is IVsBrowseObject browseObject)
                {
                    int hr = browseObject.GetProjectItem(out var hierarchy, out uint itemId);

                    if (hr == VSConstants.S_OK && itemId == VSConstants.VSITEMID_ROOT)
                    {
                        if (hierarchy != null)
                        {
                            if (ErrorHandler.Succeeded(hierarchy.GetProperty((uint)VSConstants.VSITEMID.Root, (int)__VSHPROPID.VSHPROPID_ExtObject, out var extObject)))
                            {
                                context = extObject as IVsBrowseObjectContext;

                                if (context == null)
                                {
                                    if (extObject is EnvDTE.Project dteProject)
                                    {
                                        context = dteProject.Object as IVsBrowseObjectContext;
                                    }
                                }
                            }
                        }
                    }
                }

                if (context != null)
                {
                    configuredProjects.Add(context.ConfiguredProject);
                }
            }

#if DEBUG
            if (!configuredProjects.Any())
            {
                throw new InvalidOperationException("cObjects > 0, but no configurations were found!");
            }
#endif

            _unconfiguredProject     = configuredProjects.First().UnconfiguredProject;
            _projectThreadingService = _unconfiguredProject.ProjectService.Services.ThreadingPolicy;

            if (_propertyManager == null)
            {
                _propertyManager = CreatePropertyManager(configuredProjects);

                _propertyManager.PropertyChanged  += PropertyChanged;
                _propertyManager.PropertyChanging += PropertyChanging;
            }
            else
            {
                WaitForAsync(() => _propertyManager.UpdateConfigurationsAsync(configuredProjects));
            }
        }
        public ConfiguredProjectLanguageServiceTelemetryService(ConfiguredProject project, ITelemetryService telemetryService, IProjectThreadingService projectThreadingService)
        {
            _project          = project;
            _telemetryService = telemetryService;

            _projectGuidLazy = new AsyncLazy <Guid>(async() =>
            {
                return(await _project.UnconfiguredProject.GetProjectGuidAsync());
            }, projectThreadingService.JoinableTaskFactory);
        }
Ejemplo n.º 5
0
 public CosmosPropertyPageViewModel(
     IPropertyManager propertyManager,
     IProjectThreadingService projectThreadingService)
     : base(propertyManager, projectThreadingService)
 {
 }
 public ActiveLaunchProfileCommonValueProvider(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, IProjectThreadingService projectThreadingService)
     : base(project, launchSettingsProvider, projectThreadingService)
 {
 }
 public VsSolutionEventListener(IVsService <SVsSolution, IVsSolution> solution, IProjectThreadingService threadingService)
     : base(threadingService.JoinableTaskContext)
 {
     _solution         = solution;
     _threadingService = threadingService;
 }
Ejemplo n.º 8
0
 public CommandLineArgumentsDataSource(IProjectThreadingService projectThreadingService, IActiveConfiguredProjectSubscriptionService activeProjectSubscriptionService)
     : base(projectThreadingService.JoinableTaskContext)
 {
     _activeProjectSubscriptionService = activeProjectSubscriptionService;
 }
Ejemplo n.º 9
0
 public VsService([Import(typeof(SAsyncServiceProvider))] IAsyncServiceProvider serviceProvider, IProjectThreadingService threadingService)
     : base(serviceProvider, threadingService)
 {
 }
Ejemplo n.º 10
0
        /// <summary>
        ///     Executes the specified delegate in a safe fire-and-forget manner, prevent the project from
        ///     closing until it has completed.
        /// </summary>
        /// <param name="threadingService">
        ///     The <see cref="IProjectThreadingService"/> that handles the fork.
        /// </param>
        /// <param name="asyncAction">
        ///     The async delegate to invoke. It is invoked asynchronously with respect to the caller.
        /// </param>
        /// <param name="configuredProject">
        ///     The configured project which the delegate operates on, if applicable. Can be <see langword="null"/>.
        /// </param>
        /// <param name="faultSeverity">
        ///     Suggests to the user how severe the fault is if the delegate throws.
        /// </param>
        /// <param name="options">
        ///     Influences the environment in which the delegate is executed.
        /// </param>
        public static void RunAndForget(this IProjectThreadingService threadingService, Func <Task> asyncAction, ConfiguredProject configuredProject, ProjectFaultSeverity faultSeverity = ProjectFaultSeverity.Recoverable, ForkOptions options = ForkOptions.Default)
        {
            Requires.NotNull(threadingService, nameof(threadingService));

            threadingService.Fork(asyncAction, factory: null, configuredProject: configuredProject, watsonReportSettings: s_defaultReportSettings, faultSeverity: faultSeverity, options: options);
        }
 internal CSharpProjectConfigurationProperties(
     ProjectProperties projectProperties,
     IProjectThreadingService threadingService)
     : base(projectProperties, threadingService)
 {
 }
Ejemplo n.º 12
0
        private WorkspaceProjectContextHost CreateInstance(ConfiguredProject project = null, IProjectThreadingService threadingService = null, IUnconfiguredProjectTasksService tasksService = null, IProjectSubscriptionService projectSubscriptionService = null, IActiveEditorContextTracker activeWorkspaceProjectContextTracker = null, IWorkspaceProjectContextProvider workspaceProjectContextProvider = null, IApplyChangesToWorkspaceContext applyChangesToWorkspaceContext = null)
        {
            project                              = project ?? ConfiguredProjectFactory.Create();
            threadingService                     = threadingService ?? IProjectThreadingServiceFactory.Create();
            tasksService                         = tasksService ?? IUnconfiguredProjectTasksServiceFactory.Create();
            projectSubscriptionService           = projectSubscriptionService ?? IProjectSubscriptionServiceFactory.Create();
            activeWorkspaceProjectContextTracker = activeWorkspaceProjectContextTracker ?? IActiveEditorContextTrackerFactory.Create();
            workspaceProjectContextProvider      = workspaceProjectContextProvider ?? IWorkspaceProjectContextProviderFactory.ImplementCreateProjectContextAsync(IWorkspaceProjectContextAccessorFactory.Create());
            applyChangesToWorkspaceContext       = applyChangesToWorkspaceContext ?? IApplyChangesToWorkspaceContextFactory.Create();

            return(new WorkspaceProjectContextHost(project,
                                                   threadingService,
                                                   tasksService,
                                                   projectSubscriptionService,
                                                   workspaceProjectContextProvider,
                                                   activeWorkspaceProjectContextTracker,
                                                   ExportFactoryFactory.ImplementCreateValueWithAutoDispose(() => applyChangesToWorkspaceContext)));
        }
Ejemplo n.º 13
0
 public SimpleRenameStrategy(IProjectThreadingService threadingService, IUserNotificationServices userNotificationService, IEnvironmentOptions environmentOptions, IRoslynServices roslynServices)
     : base(threadingService, userNotificationService, environmentOptions)
 {
     _roslynServices = roslynServices;
 }
Ejemplo n.º 14
0
 public DefaultHttpClient(IProjectThreadingService threadingService)
 {
     _threadingService = threadingService;
 }
Ejemplo n.º 15
0
 internal abstract AbstractGenerateNuGetPackageCommand CreateInstanceCore(
     UnconfiguredProject project,
     IProjectThreadingService threadingService,
     IVsService <SVsSolutionBuildManager, IVsSolutionBuildManager2> vsSolutionBuildManagerService,
     GeneratePackageOnBuildPropertyProvider generatePackageOnBuildPropertyProvider);
 public ProjectContextCodeModelProvider(IProjectThreadingService threadingService, ICodeModelFactory codeModelFactory, IActiveWorkspaceProjectContextHost projectContextHost)
 {
     _threadingService   = threadingService;
     _codeModelFactory   = codeModelFactory;
     _projectContextHost = projectContextHost;
 }
 public UserNotificationServices(SVsServiceProvider serviceProvider, IProjectThreadingService threadingService)
 {
     _serviceProvider  = serviceProvider;
     _threadingService = threadingService;
 }
 public PackageRestoreSharedJoinableTaskCollection(IProjectThreadingService threadingService)
 {
     JoinableTaskCollection = threadingService.JoinableTaskContext.CreateCollection();
     JoinableTaskFactory    = threadingService.JoinableTaskContext.CreateFactory(JoinableTaskCollection);
 }
Ejemplo n.º 19
0
 public ProjectOutputWindowPaneProvider(IProjectThreadingService threadingService, IVsOptionalService <SVsOutputWindow, IVsOutputWindow> outputWindow)
 {
     _threadingService = threadingService;
     _outputWindow     = outputWindow;
     _outputWindowPane = new AsyncLazy <IVsOutputWindowPane>(CreateOutputWindowPaneAsync, threadingService.JoinableTaskFactory);
 }
Ejemplo n.º 20
0
 protected PlugsProjectTreeProvider(
     IProjectThreadingService threadingService,
     UnconfiguredProject unconfiguredProject)
     : base(threadingService, unconfiguredProject)
 {
 }
        public static UnconfiguredProject Create(IProjectThreadingService threadingService)
        {
            var project = CreateDefault(threadingService);

            return(project.Object);
        }
Ejemplo n.º 22
0
 public WorkingDirectoryValueProvider(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, IProjectThreadingService projectThreadingService)
     : base(project, launchSettingsProvider, projectThreadingService)
 {
 }
Ejemplo n.º 23
0
 public EditAndContinueProvider(IActiveWorkspaceProjectContextHost projectContextHost, IProjectThreadingService threadingService)
 {
     _projectContextHost = projectContextHost;
     _threadingService   = threadingService;
 }
 private UndoScope(string renameOperationName, IVsService <DTE> dte, IProjectThreadingService threadingService)
 {
     _renameOperationName = renameOperationName;
     _dte = dte;
     _threadingService = threadingService;
 }
Ejemplo n.º 25
0
        private VsService <TService, TInterface> CreateInstance <TService, TInterface>(IAsyncServiceProvider serviceProvider = null, IProjectThreadingService threadingService = null)
        {
            serviceProvider  = serviceProvider ?? IAsyncServiceProviderFactory.Create();
            threadingService = threadingService ?? IProjectThreadingServiceFactory.Create();

            return(new VsService <TService, TInterface>(serviceProvider, threadingService.JoinableTaskContext.Context));
        }
Ejemplo n.º 26
0
        public DebugProfileLaunchTargetsProvider(ConfiguredProject configuredProject, IProjectThreadingService projectThreadingService)
        {
            Assumes.ThrowIfNull(configuredProject, nameof(configuredProject));
            Assumes.ThrowIfNull(projectThreadingService, nameof(projectThreadingService));

            _configuredProject       = configuredProject;
            _projectThreadingService = projectThreadingService;
        }
Ejemplo n.º 27
0
 internal abstract AbstractGenerateNuGetPackageCommand CreateInstanceCore(
     UnconfiguredProject project,
     IProjectThreadingService threadingService,
     Shell.SVsServiceProvider serviceProvider,
     GeneratePackageOnBuildPropertyProvider generatePackageOnBuildPropertyProvider);
 /// <summary>
 /// Creates an instance of the TaskDelayScheduler. If an originalSourceToken is passed, it will be linked to the PendingUpdateTokenSource so
 /// that cancelling that token will also flow through and cancel a pending update.
 /// </summary>
 public TaskDelayScheduler(TimeSpan taskDelayTime, IProjectThreadingService threadService, CancellationToken originalSourceToken)
 {
     _taskDelayTime      = taskDelayTime;
     _threadingService   = threadService;
     _cancellationSeries = new CancellationSeries(originalSourceToken);
 }
Ejemplo n.º 29
0
        private async Task <WorkspaceProjectContextHostInstance> CreateInitializedInstanceAsync(ConfiguredProject project = null, IProjectThreadingService threadingService = null, IUnconfiguredProjectTasksService tasksService = null, IProjectSubscriptionService projectSubscriptionService = null, IActiveEditorContextTracker activeWorkspaceProjectContextTracker = null, IWorkspaceProjectContextProvider workspaceProjectContextProvider = null, IApplyChangesToWorkspaceContext applyChangesToWorkspaceContext = null)
        {
            var instance = CreateInstance(project, threadingService, tasksService, projectSubscriptionService, activeWorkspaceProjectContextTracker, workspaceProjectContextProvider, applyChangesToWorkspaceContext);

            await instance.InitializeAsync();

            return(instance);
        }
Ejemplo n.º 30
0
        public static IUnconfiguredProjectCommonServices Create(UnconfiguredProject project = null, IPhysicalProjectTree projectTree = null, IProjectThreadingService threadingService = null, ConfiguredProject configuredProject = null, ProjectProperties projectProperties = null)
        {
            var mock = new Mock <IUnconfiguredProjectCommonServices>();

            if (project != null)
            {
                mock.Setup(s => s.Project)
                .Returns(project);
            }

            if (projectTree != null)
            {
                mock.Setup(s => s.ProjectTree)
                .Returns(projectTree);
            }

            if (threadingService != null)
            {
                mock.Setup(s => s.ThreadingService)
                .Returns(threadingService);
            }

            if (configuredProject != null)
            {
                mock.Setup(s => s.ActiveConfiguredProject)
                .Returns(configuredProject);
            }

            if (projectProperties != null)
            {
                mock.Setup(s => s.ActiveConfiguredProjectProperties)
                .Returns(projectProperties);
            }

            return(mock.Object);
        }