Esempio n. 1
0
        /// <summary>
        /// Retrieves the project-level <see cref="IPropertyPagesCatalog"/> for a <see cref="ConfiguredProject"/>.
        /// </summary>
        public static async Task <IPropertyPagesCatalog?> GetProjectLevelPropertyPagesCatalogAsync(this ConfiguredProject project)
        {
            if (project.Services.PropertyPagesCatalog is IPropertyPagesCatalogProvider catalogProvider)
            {
                return(await catalogProvider.GetCatalogAsync(PropertyPageContexts.Project));
            }

            return(null);
        }
Esempio n. 2
0
 public SLangDebuggerLaunchProvider(ConfiguredProject configuredProject)
     : base(configuredProject)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleProperties"/> class.
 /// </summary>
 public RuleProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject)
     : base(configuredProject, unconfiguredProject)
 {
 }
Esempio n. 4
0
 public static MSBuildProjectXmlService GetProjectXmlService(this ConfiguredProject confproj)
 {
     return(confproj.GetServiceFeature <MSBuildProjectXmlService>());
 }
 public Task<IReadOnlyCollection<string>> AddTemporaryFiles(ConfiguredProject configuredProject, IEnumerable<string> filesToAdd) {
     return AddTemporaryItems(configuredProject, "Content", filesToAdd);
 }
Esempio n. 6
0
 public ProjectProperties(ConfiguredProject configuredProject)
     : base(configuredProject)
 {
 }
        private static ApplyChangesToWorkspaceContext CreateInitializedInstance(out IWorkspaceProjectContext context, ConfiguredProject project = null, ICommandLineParserService commandLineParser = null, IProjectLogger logger = null, params IWorkspaceContextHandler[] handlers)
        {
            var applyChangesToWorkspace = CreateInstance(project, commandLineParser, logger, handlers);

            context = IWorkspaceProjectContextMockFactory.Create();

            applyChangesToWorkspace.Initialize(context);

            return(applyChangesToWorkspace);
        }
 public CopyRemoteItemPathCommand(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, ICoreShell coreShell) {
     _configuredProject = configuredProject;
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
     _coreShell = coreShell;
 }
 public SharedProjectReferencesProviderContext(ConfiguredProject configuredProject) : base(configuredProject)
 {
 }
 private static ApplyChangesToWorkspaceContext CreateInitializedInstance(ConfiguredProject project = null, ICommandLineParserService commandLineParser = null, IProjectLogger logger = null, params IWorkspaceContextHandler[] handlers)
 {
     return(CreateInitializedInstance(out _, project, commandLineParser, logger, handlers));
 }
Esempio n. 11
0
 public VS97AddItemCommandHandler(ConfiguredProject configuredProject, IAddItemDialogService addItemDialogService, IVsUIService <SVsShell, IVsShell> vsShell)
     : base(configuredProject, addItemDialogService, vsShell)
 {
 }
 protected MyConfiguredProjectExports(ConfiguredProject configuredProject)
     : base(configuredProject)
 {
 }
        public async Task <IRule?> GetBrowseObjectRuleAsync(IDependency dependency, IProjectCatalogSnapshot?catalogs)
        {
            Requires.NotNull(dependency, nameof(dependency));

            IImmutableDictionary <string, IPropertyPagesCatalog> namedCatalogs = await GetNamedCatalogsAsync();

            Requires.NotNull(namedCatalogs, nameof(namedCatalogs));

            if (!namedCatalogs.TryGetValue(PropertyPageContexts.BrowseObject, out IPropertyPagesCatalog browseObjectsCatalog))
            {
                // Issue https://github.com/dotnet/project-system/issues/4860 suggests this code path
                // can exist, however a repro was not found to dig deeper into the underlying cause.
                // For now just return null as the upstream caller handles null correctly anyway.
                return(null);
            }

            Rule schema = browseObjectsCatalog.GetSchema(dependency.SchemaName);

            string itemSpec = string.IsNullOrEmpty(dependency.OriginalItemSpec)
                ? dependency.Path
                : dependency.OriginalItemSpec;

            var context = ProjectPropertiesContext.GetContext(UnconfiguredProject,
                                                              itemType: dependency.SchemaItemType,
                                                              itemName: itemSpec);

            if (schema == null)
            {
                // Since we have no browse object, we still need to create *something* so
                // that standard property pages can pop up.
                Rule emptyRule = RuleExtensions.SynthesizeEmptyRule(context.ItemType);

                return(GetConfiguredProjectExports().PropertyPagesDataModelProvider.GetRule(
                           emptyRule,
                           context.File,
                           context.ItemType,
                           context.ItemName));
            }

            if (dependency.Resolved)
            {
                return(GetConfiguredProjectExports().RuleFactory.CreateResolvedReferencePageRule(
                           schema,
                           context,
                           dependency.Name,
                           dependency.Properties));
            }

            return(browseObjectsCatalog.BindToContext(schema.Name, context));

            async Task <IImmutableDictionary <string, IPropertyPagesCatalog> > GetNamedCatalogsAsync()
            {
                if (catalogs != null)
                {
                    return(catalogs.NamedCatalogs);
                }

                if (_namedCatalogs == null)
                {
                    // Note: it is unlikely that we end up here, however for cases when node providers
                    // getting their node data not from Design time build events, we might have OnDependenciesChanged
                    // event coming before initial design time build event updates NamedCatalogs in this class.
                    // Thus, just in case, explicitly request it here (GetCatalogsAsync will acquire a project read lock)
                    _namedCatalogs = await ActiveConfiguredProject.Services
                                     .PropertyPagesCatalog
                                     .GetCatalogsAsync();
                }

                return(_namedCatalogs);
            }

            ConfiguredProjectExports GetConfiguredProjectExports()
            {
                ConfiguredProject project = dependency.TargetFramework.Equals(TargetFramework.Any)
                    ? ActiveConfiguredProject
                    : _dependenciesHost.GetConfiguredProject(dependency.TargetFramework) ?? ActiveConfiguredProject;

                return(GetActiveConfiguredProjectExports(project));
            }
        }
Esempio n. 14
0
 public SourceFilesCommand(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, IApplicationShell appShell) :
     base(interactiveWorkflowProvider, appShell, new FileSystem()) {
     _configuredProject = configuredProject;
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
     _appShell = appShell;
 }
Esempio n. 15
0
 public DebuggerLaunchProviders(ConfiguredProject project)
 {
     Debuggers = new OrderPrecedenceImportCollection <IDebugLaunchProvider>(projectCapabilityCheckProvider: project);
 }
        private async Task PopulateDatabaseConnectionsListAsync(ConfiguredProject project) {
            var connections = await GetDatabaseConnectionsAsync(project);
            var index = -1;
            _targetConnections = connections;

            if (!string.IsNullOrEmpty(Settings.TargetDatabaseConnection)) {
                var indices = _targetConnections.IndexWhere(c => c.ConnectionString.EqualsIgnoreCase(Settings.TargetDatabaseConnection));
                index = indices.DefaultIfEmpty(-1).First();
            }

            Targets = _targetConnections.Select(c => c.Name).ToList();
            _selectedTargetIndex = index >= 0 ? index : 0;
            UpdateState();
        }
            public Task <TResult> OpenProjectForReadAsync <TResult>(ConfiguredProject project, Func <Project, TResult> action, CancellationToken cancellationToken = default(CancellationToken))
            {
                var result = action(_evaluationProject);

                return(Task.FromResult(result));
            }
 public RProjectSourceItemProviderExtension(UnconfiguredProject unconfiguredProject, ConfiguredProject configuredProject, IProjectLockService projectLockService, IFileSystemMirroringProjectTemporaryItems temporaryItems)
     : base(unconfiguredProject, configuredProject, projectLockService, temporaryItems) {
 }
            public Task OpenProjectForWriteAsync(ConfiguredProject project, Action <Project> action, CancellationToken cancellationToken = default(CancellationToken))
            {
                action(_evaluationProject);

                return(Task.CompletedTask);
            }
Esempio n. 20
0
        private async Task<IReadOnlyCollection<string>> AddTemporaryItems(ConfiguredProject configuredProject, string itemType, IEnumerable<string> itemPathsToAdd) {
            var unhandled = new List<string>();
            var relativePathToAdd = new List<string>();

            foreach (var path in itemPathsToAdd) {
                if (PathHelper.IsOutsideProjectDirectory(_projectDirectory, _unconfiguredProject.MakeRooted(path))) {
                    unhandled.Add(path);
                } else {
                    relativePathToAdd.Add(_unconfiguredProject.MakeRelative(path));
                }
            }

            if (relativePathToAdd.Count == 0) {
                return unhandled.AsReadOnly();
            }

            using (var access = await _projectLockService.WriteLockAsync(_unloadCancellationToken)) {
                await access.CheckoutAsync(_inMemoryImportFullPath);

                foreach (var path in relativePathToAdd) {
                    _temporaryAddedItemGroup.AddItem(itemType, path, Enumerable.Empty<KeyValuePair<string, string>>());
                }

                var project = await access.GetProjectAsync(configuredProject, _unloadCancellationToken);
                project.ReevaluateIfNecessary();
            }

            return unhandled.AsReadOnly();
        }
Esempio n. 21
0
 public MoveUpCommand(IPhysicalProjectTree projectTree, SVsServiceProvider serviceProvider, ConfiguredProject configuredProject, IProjectAccessor accessor) : base(projectTree, serviceProvider, configuredProject, accessor)
 {
 }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleProperties"/> class.
 /// </summary>
 public RuleProperties(ConfiguredProject configuredProject, string file, string itemType, string itemName)
     : base(configuredProject, file, itemType, itemName)
 {
 }
 internal TargetFrameworkGlobalBuildPropertyProvider(IProjectService projectService, ConfiguredProject configuredProject)
     : base(projectService.Services)
 {
     _configuredProject = configuredProject;
 }
        /// <summary>
        /// Creates a new instance of the configured project exports class.
        /// </summary>
        protected override ConfiguredProjectExports GetActiveConfiguredProjectExports(ConfiguredProject newActiveConfiguredProject)
        {
            Requires.NotNull(newActiveConfiguredProject, nameof(newActiveConfiguredProject));

            return(GetActiveConfiguredProjectExports <MyConfiguredProjectExports>(newActiveConfiguredProject));
        }
Esempio n. 25
0
 public ReferenceManagerCommandHandler(ConfiguredProject project, IReferencesUI referencesUI)
 {
     _referencesUI         = referencesUI;
     ReferenceManagerUsers = new VsReferenceManagerUserImportCollection(projectCapabilityCheckProvider: project);
 }
Esempio n. 26
0
 public static IProjectPropertiesProvider GetUserPropertiesProvider(this ConfiguredProject project)
 {
     return(GetFeature <IProjectPropertiesProvider>(project, "Name", "UserFile"));
 }
Esempio n. 27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectProperties"/> class.
 /// </summary>
 public ProjectProperties(ConfiguredProject configuredProject, string file, string itemType, string itemName)
     : base(configuredProject, file, itemType, itemName)
 {
 }
 public CommandLineNotificationHandler(ConfiguredProject project)
 {
     CommandLineNotifications = new OrderPrecedenceImportCollection <Action <string, BuildOptions, BuildOptions> >(projectCapabilityCheckProvider: project);
 }
Esempio n. 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectProperties"/> class.
 /// </summary>
 public ProjectProperties(ConfiguredProject configuredProject, IProjectPropertiesContext projectPropertiesContext)
     : base(configuredProject, projectPropertiesContext)
 {
 }
Esempio n. 30
0
 public RDebugLaunchProvider(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, IProjectSystemServices pss)
     : base(configuredProject) {
     _properties = configuredProject.Services.ExportProvider.GetExportedValue<ProjectProperties>();
     _interactiveWorkflow = interactiveWorkflowProvider.GetOrCreate();
     _pss = pss;
 }
Esempio n. 31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectProperties"/> class.
 /// </summary>
 public ProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject)
     : base(configuredProject, unconfiguredProject)
 {
 }
Esempio n. 32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectProperties"/> class.
 /// </summary>
 public NuProjProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject)
     : base(configuredProject, unconfiguredProject)
 {
 }
Esempio n. 33
0
 public AdditionalDesignTimeBuildInputDataSource(ConfiguredProject project, IProjectSubscriptionService projectSubscriptionService)
     : base(project, projectSubscriptionService)
 {
 }
 private async Task<IReadOnlyList<DbConnectionData>> GetDatabaseConnectionsAsync(ConfiguredProject project) {
     _noDbConnections = false;
     var connections = new List<DbConnectionData>();
     if (project != null) {
         var result = await project.GetDatabaseConnections(_pcsp);
         foreach (var s in result) {
             connections.Add(new DbConnectionData { Name = s.Name, ConnectionString = s.Value });
         }
     }
     if (connections.Count == 0) {
         connections.Add(new DbConnectionData { Name = Resources.SqlPublishDialog_NoDatabaseConnections });
         _noDbConnections = true;
     }
     return connections;
 }
Esempio n. 35
0
 public SupportedTargetFrameworksEnumProvider(IProjectAccessor projectAccessor, ConfiguredProject configuredProject)
 {
     _projectAccessor   = projectAccessor;
     _configuredProject = configuredProject;
 }
 protected FileSystemMirroringProjectSourceItemProviderExtensionBase(UnconfiguredProject unconfiguredProject, ConfiguredProject configuredProject, IProjectLockService projectLockService, IFileSystemMirroringProjectTemporaryItems temporaryItems) {
     _unconfiguredProject = unconfiguredProject;
     _configuredProject = configuredProject;
     _projectLockService = projectLockService;
     _temporaryItems = temporaryItems;
 }
Esempio n. 37
0
 public SupportedTargetFrameworksEnumValuesGenerator(IProjectAccessor projectAccessor, ConfiguredProject configuredProject)
 {
     _projectAccessor   = projectAccessor;
     _configuredProject = configuredProject;
 }
Esempio n. 38
0
 public LuaDebugger(ConfiguredProject configuredProject)
     : base(configuredProject)
 {
 }
Esempio n. 39
0
 protected abstract Task OnAddedNodesAsync(ConfiguredProject configuredProject, IEnumerable <IProjectTree> addedNodes, IProjectTree target);
Esempio n. 40
0
 public Task<IReadOnlyCollection<string>> AddTemporaryDirectories(ConfiguredProject configuredProject, IEnumerable<string> directoriesToAdd) {
     return AddTemporaryItems(configuredProject, "Folder", directoriesToAdd);
 }
Esempio n. 41
0
        internal AbstractMoveCommand CreateAbstractInstance(IPhysicalProjectTree projectTree = null, Shell.SVsServiceProvider serviceProvider = null, ConfiguredProject configuredProject = null)
        {
            projectTree       = projectTree ?? IPhysicalProjectTreeFactory.Create();
            serviceProvider   = serviceProvider ?? SVsServiceProviderFactory.Create();
            configuredProject = configuredProject ?? ConfiguredProjectFactory.Create();

            return(CreateInstance(projectTree, serviceProvider, configuredProject));
        }
Esempio n. 42
0
 public ProjectProperties(ConfiguredProject configuredProject)
     : base(configuredProject) {
     _fileSystem = new FileSystem();
 }
Esempio n. 43
0
 internal abstract AbstractMoveCommand CreateInstance(IPhysicalProjectTree projectTree, Shell.SVsServiceProvider serviceProvider, ConfiguredProject configuredProject);
 public XSharpDebuggerLaunchProvider(ConfiguredProject configuredProject)
     : base(configuredProject)
 {
 }
 public SupportedTargetFrameworksEnumProvider(
     ConfiguredProject project,
     IProjectSubscriptionService subscriptionService)
     : base(project, subscriptionService)
 {
 }
Esempio n. 46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleProperties"/> class.
 /// </summary>
 public RuleProperties(ConfiguredProject configuredProject, IProjectPropertiesContext projectPropertiesContext)
     : base(configuredProject, projectPropertiesContext)
 {
 }
 public CopyRemoteItemPathCommand(ConfiguredProject configuredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider, ICoreShell coreShell)
 {
     _configuredProject           = configuredProject;
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
     _coreShell = coreShell;
 }
    [ImportingConstructor] // NOTE: Took me two days to realise this line was missing. Launcher won't work otherwise.
    public DebugLauncher (ConfiguredProject configuredProject)
      : base (configuredProject)
    {

    }
 public PackageRestoreConfiguredInput(ConfiguredProject project, IVsProjectRestoreInfo2 restoreInfo)
 {
     Project     = project;
     RestoreInfo = restoreInfo;
 }