Esempio n. 1
0
 public VisualBasicVsContainedLanguageComponentsFactory(
     IUnconfiguredProjectCommonServices commonServices,
     SVsServiceProvider serviceProvider,
     IUnconfiguredProjectVsServices projectServices,
     IProjectHostProvider projectHostProvider,
     ILanguageServiceHost languageServiceHost)
     : base(commonServices, serviceProvider, projectServices, projectHostProvider, languageServiceHost, VisualBasicLanguageServiceGuid)
 {
 }
 public VsContainedLanguageComponentsFactoryBase(SVsServiceProvider serviceProvider,
                                                 IUnconfiguredProjectVsServices projectServices,
                                                 IProjectHostProvider projectHostProvider,
                                                 Guid languageServiceGuid)
 {
     ServiceProvider     = serviceProvider;
     ProjectServices     = projectServices;
     LanguageServiceGuid = languageServiceGuid;
     ProjectHostProvider = projectHostProvider;
 }
Esempio n. 3
0
 public TestVisualBasicVSImports(VSLangProj.VSProject vsProject,
                                 IProjectThreadingService threadingService,
                                 IActiveConfiguredValue <ConfiguredProject> activeConfiguredProject,
                                 IProjectAccessor projectAccessor,
                                 IUnconfiguredProjectVsServices unconfiguredProjectVSServices,
                                 TestVisualBasicNamespaceImportsList importsList)
     : base(vsProject, threadingService, activeConfiguredProject, projectAccessor, unconfiguredProjectVSServices, importsList)
 {
     _testImportsList = importsList;
 }
        public VsContainedLanguageComponentsFactory(IVsService <SAsyncServiceProvider, IOleAsyncServiceProvider> serviceProvider,
                                                    IUnconfiguredProjectVsServices projectVsServices,
                                                    IActiveWorkspaceProjectContextHost projectContextHost)
        {
            _serviceProvider    = serviceProvider;
            _projectVsServices  = projectVsServices;
            _projectContextHost = projectContextHost;

            _containedLanguageFactory = new AsyncLazy <IVsContainedLanguageFactory?>(GetContainedLanguageFactoryAsync, projectVsServices.ThreadingService.JoinableTaskFactory);
        }
Esempio n. 5
0
        protected AbstractAddClassProjectCommand(IPhysicalProjectTree projectTree, IUnconfiguredProjectVsServices projectVsServices, IVsUIService <IVsAddProjectItemDlg> addItemDialog)
        {
            Requires.NotNull(projectTree, nameof(projectTree));
            Requires.NotNull(projectVsServices, nameof(projectVsServices));
            Requires.NotNull(addItemDialog, nameof(addItemDialog));

            _projectTree       = projectTree;
            _projectVsServices = projectVsServices;
            _addItemDialog     = addItemDialog;
        }
 private VisualBasicVSImports CreateInstance(
     VSLangProj.VSProject vsProject            = null,
     IProjectThreadingService threadingService = null,
     ActiveConfiguredProject <ConfiguredProject> activeConfiguredProject = null,
     IProjectAccessor projectAccessor           = null,
     IUnconfiguredProjectVsServices vsServices  = null,
     VisualBasicNamespaceImportsList importList = null)
 {
     return(new VisualBasicVSImports(vsProject, threadingService, activeConfiguredProject, projectAccessor, vsServices, importList));
 }
Esempio n. 7
0
        public AbstractAddClassProjectCommand(IPhysicalProjectTree projectTree, IUnconfiguredProjectVsServices projectVsServices, SVsServiceProvider serviceProvider)
        {
            Requires.NotNull(projectTree, nameof(IPhysicalProjectTree));
            Requires.NotNull(projectVsServices, nameof(IUnconfiguredProjectVsServices));
            Requires.NotNull(serviceProvider, nameof(SVsServiceProvider));

            _projectTree       = projectTree;
            _projectVsServices = projectVsServices;
            _serviceProvider   = serviceProvider;
        }
Esempio n. 8
0
        public CreateFileFromTemplateService(IUnconfiguredProjectVsServices projectVsServices, IDteServices dteServices, ProjectProperties properties)
        {
            Requires.NotNull(projectVsServices, nameof(projectVsServices));
            Requires.NotNull(dteServices, nameof(dteServices));
            Requires.NotNull(properties, nameof(properties));

            _projectVsServices = projectVsServices;
            _dteServices       = dteServices;
            _properties        = properties;
        }
 private StartupProjectRegistrar CreateInstance(
     IUnconfiguredProjectVsServices projectVsServices,
     SVsServiceProvider serviceProvider,
     ActiveConfiguredProject <StartupProjectRegistrar.DebuggerLaunchProviders> launchProviders)
 {
     return(new StartupProjectRegistrar(
                projectVsServices,
                serviceProvider,
                IProjectThreadingServiceFactory.Create(),
                IActiveConfiguredProjectSubscriptionServiceFactory.CreateInstance(),
                launchProviders));
 }
Esempio n. 10
0
 internal Renamer(IUnconfiguredProjectVsServices projectVsServices,
                  IUnconfiguredProjectTasksService unconfiguredProjectTasksService,
                  VisualStudioWorkspace workspace,
                  IVsService <Shell.Interop.SDTE, EnvDTE.DTE> dte,
                  IEnvironmentOptions environmentOptions,
                  IUserNotificationServices userNotificationServices,
                  IRoslynServices roslynServices,
                  IWaitIndicator waitService,
                  IRefactorNotifyService refactorNotifyService)
     : this(projectVsServices, unconfiguredProjectTasksService, workspace as Workspace, dte, environmentOptions, userNotificationServices, roslynServices, waitService, refactorNotifyService)
 {
 }
Esempio n. 11
0
 public SDKVersionTelemetryServiceInstance(
     IUnconfiguredProjectVsServices projectVsServices,
     ISafeProjectGuidService projectGuidService,
     ITelemetryService telemetryService,
     IUnconfiguredProjectTasksService unconfiguredProjectTasksService)
     : base(projectVsServices.ThreadingService.JoinableTaskContext)
 {
     _projectVsServices  = projectVsServices;
     _projectGuidService = projectGuidService;
     _telemetryService   = telemetryService;
     _unconfiguredProjectTasksService = unconfiguredProjectTasksService;
 }
Esempio n. 12
0
 public SDKVersionTelemetryServiceInstance(
     IUnconfiguredProjectVsServices projectVsServices,
     ISafeProjectGuidService projectGuidService,
     ITelemetryService telemetryService,
     IUnconfiguredProjectTasksService unconfiguredProjectTasksService)
     : base(synchronousDisposal: true)
 {
     _projectVsServices  = projectVsServices;
     _projectGuidService = projectGuidService;
     _telemetryService   = telemetryService;
     _unconfiguredProjectTasksService = unconfiguredProjectTasksService;
 }
 public PackageRestoreInitiator(
     IUnconfiguredProjectVsServices projectVsServices,
     IVsSolutionRestoreService solutionRestoreService,
     IActiveConfigurationGroupService activeConfigurationGroupService,
     IProjectLogger logger)
     : base(projectVsServices.ThreadingService.JoinableTaskContext)
 {
     _projectVsServices               = projectVsServices;
     _solutionRestoreService          = solutionRestoreService;
     _activeConfigurationGroupService = activeConfigurationGroupService;
     _logger = logger;
 }
Esempio n. 14
0
        public VsContainedLanguageComponentsFactory(IVsService <SAsyncServiceProvider, IOleAsyncServiceProvider> serviceProvider,
                                                    IUnconfiguredProjectVsServices projectVsServices,
                                                    IProjectHostProvider projectHostProvider,
                                                    ILanguageServiceHost languageServiceHost)
        {
            _serviceProvider     = serviceProvider;
            _projectVsServices   = projectVsServices;
            _projectHostProvider = projectHostProvider;
            _languageServiceHost = languageServiceHost;

            _containedLanguageFactory = new AsyncLazy <IVsContainedLanguageFactory>(GetContainedLanguageFactoryAsync, projectVsServices.ThreadingService.JoinableTaskFactory);
        }
 public NuGetRestorer(
     IUnconfiguredProjectVsServices projectVsServices,
     IVsSolutionRestoreService solutionRestoreService,
     IActiveConfiguredProjectSubscriptionService activeConfiguredProjectSubscriptionService,
     ActiveConfiguredProjectsProvider activeConfiguredProjectsProvider)
     : base(projectVsServices.ThreadingService.JoinableTaskContext)
 {
     _projectVsServices      = projectVsServices;
     _solutionRestoreService = solutionRestoreService;
     _activeConfiguredProjectSubscriptionService = activeConfiguredProjectSubscriptionService;
     _activeConfiguredProjectsProvider           = activeConfiguredProjectsProvider;
 }
Esempio n. 16
0
 public DependenciesTreeConfiguredProjectSearchContext(
     DependenciesTreeSearchContext inner,
     IProjectTree targetRootNode,
     IVsHierarchyItemManager hierarchyItemManager,
     IUnconfiguredProjectVsServices projectVsServices,
     IRelationProvider relationProvider)
 {
     _inner = inner;
     _hierarchyItemManager = hierarchyItemManager;
     _projectVsServices    = projectVsServices;
     _relationProvider     = relationProvider;
     _targetRootNode       = targetRootNode;
 }
Esempio n. 17
0
 public VsContainedLanguageComponentsFactory(
     IUnconfiguredProjectCommonServices commonServices,
     SVsServiceProvider serviceProvider,
     IUnconfiguredProjectVsServices projectServices,
     IProjectHostProvider projectHostProvider,
     ILanguageServiceHost languageServiceHost)
     : base(commonServices.ThreadingService.JoinableTaskContext)
 {
     _serviceProvider     = serviceProvider;
     _projectVsServices   = projectServices;
     _projectHostProvider = projectHostProvider;
     _languageServiceHost = languageServiceHost;
 }
Esempio n. 18
0
        public FileRenameTracker(IUnconfiguredProjectVsServices projectVsServices, VisualStudioWorkspace visualStudioWorkspace, IOptionsSettings optionsSettings, IUserNotificationServices userNotificationServices, IRoslynServices roslynServices)
        {
            Requires.NotNull(projectVsServices, nameof(projectVsServices));
            Requires.NotNull(visualStudioWorkspace, nameof(visualStudioWorkspace));
            Requires.NotNull(optionsSettings, nameof(optionsSettings));
            Requires.NotNull(userNotificationServices, nameof(userNotificationServices));
            Requires.NotNull(roslynServices, nameof(roslynServices));

            _projectVsServices        = projectVsServices;
            _visualStudioWorkspace    = visualStudioWorkspace;
            _optionsSettings          = optionsSettings;
            _userNotificationServices = userNotificationServices;
            _roslynServices           = roslynServices;
        }
Esempio n. 19
0
        public FileRenameTracker(IUnconfiguredProjectVsServices projectVsServices, VisualStudioWorkspace visualStudioWorkspace, IEnvironmentOptions environmentOptions, IUserNotificationServices userNotificationServices, IRoslynServices roslynServices)
        {
            Requires.NotNull(projectVsServices, nameof(projectVsServices));
            Requires.NotNull(visualStudioWorkspace, nameof(visualStudioWorkspace));
            Requires.NotNull(environmentOptions, nameof(environmentOptions));
            Requires.NotNull(userNotificationServices, nameof(userNotificationServices));
            Requires.NotNull(roslynServices, nameof(roslynServices));

            _projectVsServices        = projectVsServices;
            _visualStudioWorkspace    = visualStudioWorkspace;
            _environmentOptions       = environmentOptions;
            _userNotificationServices = userNotificationServices;
            _roslynServices           = roslynServices;
        }
Esempio n. 20
0
 public DependenciesTreeProjectSearchContext(
     DependenciesTreeSearchContext outer,
     UnconfiguredProject unconfiguredProject,
     IProjectTree dependenciesNode,
     IVsHierarchyItemManager hierarchyItemManager,
     IUnconfiguredProjectVsServices projectVsServices,
     IRelationProvider relationProvider)
 {
     _inner = outer;
     UnconfiguredProject   = unconfiguredProject;
     _dependenciesNode     = dependenciesNode;
     _hierarchyItemManager = hierarchyItemManager;
     _projectVsServices    = projectVsServices;
     _relationProvider     = relationProvider;
 }
Esempio n. 21
0
        public void SetObjects(UInt32 cObjects, Object[] ppunk)
        {
            _unconfiguredProject = null;
            if (cObjects == 0)
            {
                // If we have never configured anything (maybe a failure occurred on open so app designer is closing us). In this case
                // do nothing
                if (_threadHandling != null)
                {
                    SetObjects(true);
                }
                return;
            }

            if (ppunk.Length < cObjects)
            {
                throw new ArgumentOutOfRangeException("cObjects");
            }

            List <string> configurations = new List <string>();

            // Look for an IVsBrowseObject
            for (int i = 0; i < cObjects; ++i)
            {
                IVsBrowseObject browseObj = null;
                browseObj = ppunk[i] as IVsBrowseObject;

                if (browseObj != null)
                {
                    IVsHierarchy hier = null;
                    uint         itemid;
                    int          hr;
                    hr = browseObj.GetProjectItem(out hier, out itemid);
                    if (hr == VSConstants.S_OK && itemid == VSConstants.VSITEMID_ROOT)
                    {
                        _unconfiguredProject = GetUnconfiguredProject(hier);

                        // We need to save ThreadHandling because the appdesigner will call SetObjects with null, and then call
                        // Deactivate(). We need to run Async code during Deactivate() which requires ThreadHandling.

                        IUnconfiguredProjectVsServices projectVsServices = _unconfiguredProject.Services.ExportProvider.GetExportedValue <IUnconfiguredProjectVsServices>();
                        _threadHandling = projectVsServices.ThreadingService;
                    }
                }
            }

            OnSetObjects(false);
        }
Esempio n. 22
0
 public TestRenamerProjectTreeActionHandler(
     UnconfiguredProject unconfiguredProject,
     IUnconfiguredProjectVsServices projectVsServices,
     [Import(typeof(VisualStudioWorkspace))] Workspace workspace,
     IEnvironmentOptions environmentOptions,
     IUserNotificationServices userNotificationServices,
     IRoslynServices roslynServices,
     IWaitIndicator waitService,
     IVsOnlineServices vsOnlineServices,
     IProjectThreadingService threadingService,
     IVsUIService <IVsExtensibility, IVsExtensibility3> extensibility,
     IVsService <SVsOperationProgress, IVsOperationProgressStatusService> operationProgressService) :
     base(unconfiguredProject, projectVsServices, workspace, environmentOptions, userNotificationServices, roslynServices, waitService,
          vsOnlineServices, threadingService, extensibility, operationProgressService)
 {
 }
        public AbstractAddItemCommand(
            IPhysicalProjectTree projectTree,
            IUnconfiguredProjectVsServices projectVsServices,
            SVsServiceProvider serviceProvider,
            OrderAddItemHintReceiver orderAddItemHintReceiver)
        {
            Requires.NotNull(projectTree, nameof(projectTree));
            Requires.NotNull(projectVsServices, nameof(projectVsServices));
            Requires.NotNull(serviceProvider, nameof(serviceProvider));
            Requires.NotNull(orderAddItemHintReceiver, nameof(orderAddItemHintReceiver));

            _projectTree              = projectTree;
            _projectVsServices        = projectVsServices;
            _serviceProvider          = serviceProvider;
            _orderAddItemHintReceiver = orderAddItemHintReceiver;
        }
Esempio n. 24
0
        public VisualBasicVSImports(
            [Import(ExportContractNames.VsTypes.CpsVSProject)] VSLangProj.VSProject vsProject,
            IProjectThreadingService threadingService,
            IActiveConfiguredValue <ConfiguredProject> activeConfiguredProject,
            IProjectAccessor projectAccessor,
            IUnconfiguredProjectVsServices unconfiguredProjectVSServices,
            VisualBasicNamespaceImportsList importsList)
        {
            _vsProject = vsProject;
            _activeConfiguredProject       = activeConfiguredProject;
            _projectAccessor               = projectAccessor;
            _threadingService              = threadingService;
            _unconfiguredProjectVSServices = unconfiguredProjectVSServices;
            _importsList = importsList;

            AddEventSource(this);
        }
 public TestRenamerProjectTreeActionHandler(
     UnconfiguredProject unconfiguredProject,
     IUnconfiguredProjectVsServices projectVsServices,
     [Import(typeof(VisualStudioWorkspace))] Workspace workspace,
     IEnvironmentOptions environmentOptions,
     IUserNotificationServices userNotificationServices,
     IRoslynServices roslynServices,
     IWaitIndicator waitService,
     IVsOnlineServices vsOnlineServices,
     [Import(ExportContractNames.Scopes.UnconfiguredProject)] IProjectAsynchronousTasksService projectAsynchronousTasksService,
     IProjectThreadingService threadingService,
     IVsUIService <IVsExtensibility, IVsExtensibility3> extensibility,
     IVsService <SVsOperationProgress, IVsOperationProgressStatusService> operationProgressService,
     IVsService <SVsSettingsPersistenceManager, ISettingsManager> settingsManagerService) :
     base(unconfiguredProject, projectVsServices, workspace, environmentOptions, userNotificationServices, roslynServices, waitService,
          vsOnlineServices, projectAsynchronousTasksService, threadingService, extensibility, operationProgressService, settingsManagerService)
 {
 }
Esempio n. 26
0
        /// <summary>
        /// Show the item dialog window to add new/existing items.
        /// </summary>
        private static async Task ShowAddItemDialogAsync(
            IPhysicalProjectTree projectTree,
            IUnconfiguredProjectVsServices projectVsServices,
            SVsServiceProvider serviceProvider,
            IProjectTree target,
            AddItemAction addItemAction)
        {
            Requires.NotNull(projectTree, nameof(projectTree));
            Requires.NotNull(projectVsServices, nameof(projectVsServices));
            Requires.NotNull(serviceProvider, nameof(serviceProvider));
            Requires.NotNull(target, nameof(target));

            await projectVsServices.ThreadingService.SwitchToUIThread();

            var strBrowseLocations = projectTree.TreeProvider.GetAddNewItemDirectory(target);

            ShowAddItemDialog(serviceProvider, target, projectVsServices.VsProject, strBrowseLocations, addItemAction);
        }
Esempio n. 27
0
        public void SetObjects(uint cObjects, object[] ppunk)
        {
            UnconfiguredProject = null;
            if (cObjects == 0)
            {
                // If we have never configured anything (maybe a failure occurred on open so app designer is closing us). In this case
                // do nothing
                if (_threadHandling != null)
                {
                    SetObjects(isClosing: true);
                }
                return;
            }

            if (ppunk.Length < cObjects)
            {
                throw new ArgumentOutOfRangeException(nameof(cObjects));
            }

            // Look for an IVsBrowseObject
            for (int i = 0; i < cObjects; ++i)
            {
                if (ppunk[i] is IVsBrowseObject browseObj)
                {
                    HResult hr = browseObj.GetProjectItem(out IVsHierarchy hier, out uint itemid);
                    if (hr.IsOK && itemid == VSConstants.VSITEMID_ROOT)
                    {
                        UnconfiguredProject = hier.GetUnconfiguredProject();

                        // We need to save ThreadHandling because the appdesigner will call SetObjects with null, and then call
                        // Deactivate(). We need to run Async code during Deactivate() which requires ThreadHandling.

                        if (UnconfiguredProject != null)
                        {
                            IUnconfiguredProjectVsServices projectVsServices = UnconfiguredProject.Services.ExportProvider.GetExportedValue <IUnconfiguredProjectVsServices>();
                            _threadHandling = projectVsServices.ThreadingService;
                        }
                    }
                }
            }

            _ = OnSetObjects(isClosing: false);
        }
        private static ConsoleDebugTargetsProvider CreateInstance(
            ConfiguredProject?configuredProject = null,
            IDebugTokenReplacer?tokenReplacer   = null,
            IFileSystem?fileSystem         = null,
            IEnvironmentHelper?environment = null,
            IActiveDebugFrameworkServices?activeDebugFramework = null,
            ProjectProperties?properties = null,
            IProjectThreadingService?threadingService = null,
            IVsDebugger10?debugger = null)
        {
            environment ??= Mock.Of <IEnvironmentHelper>();
            tokenReplacer ??= IDebugTokenReplacerFactory.Create();
            activeDebugFramework ??= IActiveDebugFrameworkServicesFactory.ImplementGetConfiguredProjectForActiveFrameworkAsync(configuredProject);
            threadingService ??= IProjectThreadingServiceFactory.Create();
            debugger ??= IVsDebugger10Factory.ImplementIsIntegratedConsoleEnabled(enabled: false);

            IUnconfiguredProjectVsServices unconfiguredProjectVsServices = IUnconfiguredProjectVsServicesFactory.Implement(() => IVsHierarchyFactory.Create());

            return(new ConsoleDebugTargetsProvider(unconfiguredProjectVsServices, configuredProject, tokenReplacer, fileSystem, environment, activeDebugFramework, properties, threadingService, IVsUIServiceFactory.Create <SVsShellDebugger, IVsDebugger10>(debugger)));
        }
Esempio n. 29
0
 internal Renamer(IUnconfiguredProjectVsServices projectVsServices,
                  IUnconfiguredProjectTasksService unconfiguredProjectTasksService,
                  [Import(typeof(VisualStudioWorkspace))] Workspace workspace,
                  IVsUIService <Shell.Interop.SDTE, DTE> dte,
                  IEnvironmentOptions environmentOptions,
                  IUserNotificationServices userNotificationServices,
                  IRoslynServices roslynServices,
                  IWaitIndicator waitService,
                  IRefactorNotifyService refactorNotifyService)
 {
     _projectVsServices = projectVsServices;
     _unconfiguredProjectTasksService = unconfiguredProjectTasksService;
     _workspace                = workspace;
     _dte                      = dte;
     _environmentOptions       = environmentOptions;
     _userNotificationServices = userNotificationServices;
     _roslynServices           = roslynServices;
     _waitService              = waitService;
     _refactorNotifyService    = refactorNotifyService;
 }
Esempio n. 30
0
 public ConsoleDebugTargetsProvider(
     IUnconfiguredProjectVsServices unconfiguredProjectVsServices,
     ConfiguredProject project,
     IDebugTokenReplacer tokenReplacer,
     IFileSystem fileSystem,
     IEnvironmentHelper environment,
     IActiveDebugFrameworkServices activeDebugFramework,
     ProjectProperties properties,
     IProjectThreadingService threadingService,
     IVsUIService <SVsShellDebugger, IVsDebugger10> debugger)
 {
     _project = project;
     _unconfiguredProjectVsServices = unconfiguredProjectVsServices;
     _tokenReplacer        = tokenReplacer;
     _fileSystem           = fileSystem;
     _environment          = environment;
     _activeDebugFramework = activeDebugFramework;
     _properties           = properties;
     _threadingService     = threadingService;
     _debugger             = debugger;
 }