示例#1
0
 public LoadWorkspaceCommand(IApplicationShell appShell, IRInteractiveWorkflow interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdLoadWorkspace) {
     _appShell = appShell;
     _interactiveWorkflow = interactiveWorkflow;
     _rSession = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
 }
示例#2
0
        /// <summary>
        /// Retrieve the CPS enabled JoinableTaskFactory for the current version of Visual Studio.
        /// This overrides the default VsTaskLibraryHelper.ServiceInstance JTF.
        /// </summary>
        public static void SetJoinableTaskFactoryFromService(IProjectServiceAccessor projectServiceAccessor)
        {
            if (projectServiceAccessor == null)
            {
                throw new ArgumentNullException(nameof(projectServiceAccessor));
            }

            if (_joinableTaskFactory == null)
            {
                _joinableTaskFactory = new Lazy <JoinableTaskFactory>(() =>
                {
#if VS14
                    // Use IThreadHandling.AsyncPump for Visual Studio 2015
                    ProjectService projectService  = projectServiceAccessor.GetProjectService();
                    IThreadHandling threadHandling = projectService.Services.ThreadingPolicy;
                    return(threadHandling.AsyncPump);
#else
                    // Use IProjectService for Visual Studio 2017
                    var projectService = projectServiceAccessor.GetProjectService();
                    return(projectService.Services.ThreadingPolicy.JoinableTaskFactory);
#endif
                },
                                                                      // This option helps avoiding deadlocks caused by CPS trying to create ProjectServiceHost
                                                                      // PublicationOnly mode lets parallel threads execute value factory method without
                                                                      // being blocked on each other.
                                                                      // It is correct behavior in this case as the value factory provides the same value
                                                                      // each time it is called and Lazy is used just for caching the value for perf reasons.
                                                                      LazyThreadSafetyMode.PublicationOnly);
            }
        }
 public LaunchProfileDataProvider(
     IProjectServiceAccessor projectServiceAccessor,
     IProjectStateProvider projectStateProvider)
     : base(projectServiceAccessor)
 {
     _projectStateProvider = projectStateProvider;
 }
示例#4
0
 public SaveWorkspaceCommand(IRInteractiveWorkflow interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveWorkspace)
 {
     _rSession = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
     _interactiveWorkflow    = interactiveWorkflow;
 }
示例#5
0
 public LoadWorkspaceCommand(IApplicationShell appShell, IRInteractiveWorkflow interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdLoadWorkspace)
 {
     _appShell               = appShell;
     _interactiveWorkflow    = interactiveWorkflow;
     _rSession               = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
 }
示例#6
0
 public LoadWorkspaceCommand(ICoreShell shell, IRInteractiveWorkflowVisual interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdLoadWorkspace)
 {
     _shell = shell;
     _interactiveWorkflow    = interactiveWorkflow;
     _rSession               = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
 }
 public DependenciesTreeSearchProvider(
     [ImportMany] IEnumerable <IDependenciesTreeSearchProvider> providers,
     JoinableTaskContext joinableTaskContext,
     IVsHierarchyItemManager hierarchyItemManager,
     IProjectServiceAccessor projectServiceAccessor,
     IRelationProvider relationProvider)
 {
     _providers              = providers.ToImmutableArray();
     _joinableTaskContext    = joinableTaskContext;
     _hierarchyItemManager   = hierarchyItemManager;
     _projectServiceAccessor = projectServiceAccessor;
     _relationProvider       = relationProvider;
 }
        public static void SetJoinableTaskFactoryFromService(IProjectServiceAccessor projectServiceAccessor)
        {
            Requires.NotNull(projectServiceAccessor, nameof(projectServiceAccessor));

            if (_joinableTaskFactory == null)
            {
                _joinableTaskFactory = new Lazy <JoinableTaskFactory>(() =>
                {
                    // Use IProjectService for Visual Studio 2017
                    var projectService = projectServiceAccessor.GetProjectService();
                    return(projectService.Services.ThreadingPolicy.JoinableTaskFactory);
                },
                                                                      // This option helps avoiding deadlocks caused by CPS trying to create ProjectServiceHost
                                                                      // PublicationOnly mode lets parallel threads execute value factory method without
                                                                      // being blocked on each other.
                                                                      // It is correct behavior in this case as the value factory provides the same value
                                                                      // each time it is called and Lazy is used just for caching the value for perf reasons.
                                                                      LazyThreadSafetyMode.PublicationOnly);
            }
        }
示例#9
0
        /// <summary>
        /// Retrieve the CPS enabled JoinableTaskFactory for the current version of Visual Studio.
        /// This overrides the default VsTaskLibraryHelper.ServiceInstance JTF.
        /// </summary>
        public static void SetJoinableTaskFactoryFromService(IProjectServiceAccessor projectServiceAccessor)
        {
            if (projectServiceAccessor == null)
            {
                throw new ArgumentNullException(nameof(projectServiceAccessor));
            }

            if (_joinableTaskFactory == null)
            {
                _joinableTaskFactory = new Lazy <JoinableTaskFactory>(() =>
                {
#if VS14
                    // Use IThreadHandling.AsyncPump for Visual Studio 2015
                    ProjectService projectService  = projectServiceAccessor.GetProjectService();
                    IThreadHandling threadHandling = projectService.Services.ThreadingPolicy;
                    return(threadHandling.AsyncPump);
#else
                    // Use IProjectService for Visual Studio 2017
                    IProjectService projectService = projectServiceAccessor.GetProjectService();
                    return(projectService.Services.ThreadingPolicy.JoinableTaskFactory);
#endif
                });
            }
        }
示例#10
0
 public MissingSetupComponentRegistrationServiceInitializer(IProjectServiceAccessor projectServiceAccessor)
 {
     _projectServiceAccessor = projectServiceAccessor;
 }
示例#11
0
 public LaunchProfileUIPropertyDataProvider(IProjectServiceAccessor projectServiceAccessor)
     : base(projectServiceAccessor)
 {
 }
 public CategoryDataProvider(IProjectServiceAccessor projectServiceAccessor)
     : base(projectServiceAccessor)
 {
 }
 public UIPropertyDataProvider(IProjectServiceAccessor projectServiceAccessor, IPropertyPageQueryCacheProvider queryCacheProvider)
     : base(projectServiceAccessor)
 {
     _queryCacheProvider = queryCacheProvider;
 }
 public PropertyPageDataProvider(IProjectServiceAccessor projectServiceAccessor, IProjectStateProvider projectStateProvider)
     : base(projectServiceAccessor)
 {
     _projectStateProvider = projectStateProvider;
 }
 public SaveWorkspaceCommand(IRInteractiveWorkflow interactiveWorkflow, IProjectServiceAccessor projectServiceAccessor) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveWorkspace) {
     _rSession = interactiveWorkflow.RSession;
     _projectServiceAccessor = projectServiceAccessor;
     _interactiveWorkflow = interactiveWorkflow;
 }
示例#16
0
 public LaunchProfileTypeDataProvider(
     IProjectServiceAccessor projectServiceAccessor)
     : base(projectServiceAccessor)
 {
 }
 public LaunchProfileCategoryDataProvider(IProjectServiceAccessor projectServiceAccessor)
     : base(projectServiceAccessor)
 {
 }
 protected QueryDataProviderBase(IProjectServiceAccessor projectServiceAccessor)
 {
     _projectService = new Lazy <IProjectService2>(
         () => (IProjectService2)projectServiceAccessor.GetProjectService(),
         System.Threading.LazyThreadSafetyMode.PublicationOnly);
 }
示例#19
0
 public IncrementalBuildFailureDetector(
     ISolutionBuildManager solutionBuildEvents,
     IRunningDocumentTable rdtEvents,
     IProjectServiceAccessor projectServiceAccessor,
     JoinableTaskContext joinableTaskContext)
     : base(new(joinableTaskContext))
 public DotNetCoreProjectCompatibilityDetectorInitializer(IProjectServiceAccessor projectServiceAccessor)
 {
     _projectServiceAccessor = projectServiceAccessor;
 }
示例#21
0
 public PropertyPageDataProvider(IProjectServiceAccessor projectServiceAccessor)
     : base(projectServiceAccessor)
 {
 }
示例#22
0
 public ReferenceCleanupService(IProjectServiceAccessor projectServiceAccessor)
 {
     _projectService = new Lazy <IProjectService2>(
         () => (IProjectService2)projectServiceAccessor.GetProjectService(),
         LazyThreadSafetyMode.PublicationOnly);
 }
 public UIPropertyEditorDataProvider(IProjectServiceAccessor projectServiceAccessor)
     : base(projectServiceAccessor)
 {
 }
示例#24
0
 public DependenciesGraphProjectContextProvider(IProjectExportProvider projectExportProvider,
                                                IProjectServiceAccessor projectServiceAccessor)
 {
     ProjectServiceAccessor = projectServiceAccessor;
     ProjectExportProvider  = projectExportProvider;
 }
 public ProjectExportProvider(IProjectServiceAccessor serviceAccessor)
 {
     ProjectServiceAccesspr = serviceAccessor;
 }
        public DotNetCoreProjectCompatibilityDetectorInitializer(IProjectServiceAccessor projectServiceAccessor)
        {
            Requires.NotNull(projectServiceAccessor, nameof(projectServiceAccessor));

            _projectServiceAccessor = projectServiceAccessor;
        }