public override async Task <string> OnGetEvaluatedPropertyValueAsync(string propertyName, string evaluatedPropertyValue, IProjectProperties defaultProperties)
        {
            ActiveConfiguredObjects <ConfiguredProject>?configuredProjects = await _projectProvider.GetActiveConfiguredProjectsAsync();

            if (configuredProjects == null)
            {
                return("");
            }

            var builder = PooledArray <string> .GetInstance(capacity : configuredProjects.Objects.Length);

            foreach (ConfiguredProject configuredProject in configuredProjects.Objects)
            {
                ProjectProperties    projectProperties = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>();
                ConfigurationGeneral configuration     = await projectProperties.GetConfigurationGeneralPropertiesAsync();

                string?currentPlatformMoniker = (string?)await configuration.TargetPlatformIdentifier.GetValueAsync();

                string?currentPlatformVersion = (string?)await configuration.TargetPlatformVersion.GetValueAsync();

                Assumes.NotNull(currentPlatformMoniker);
                builder.Add($"{ currentPlatformMoniker }, Version={ currentPlatformVersion }");
            }

            return(string.Join(";", builder.ToArrayAndFree()));
        }
示例#2
0
        public override async Task <string> OnGetEvaluatedPropertyValueAsync(string evaluatedPropertyValue, IProjectProperties defaultProperties)
        {
            ActiveConfiguredObjects <ConfiguredProject> configuredProjects = await _projectProvider.GetActiveConfiguredProjectsAsync();

            ImmutableArray <string> .Builder builder = ImmutableArray.CreateBuilder <string>();
            foreach (ConfiguredProject configuredProject in configuredProjects.Objects)
            {
                ProjectProperties    projectProperties = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>();
                ConfigurationGeneral configuration     = await projectProperties.GetConfigurationGeneralPropertiesAsync();

                string currentTargetFrameworkMoniker = (string)await configuration.TargetFrameworkMoniker.GetValueAsync();

                builder.Add(currentTargetFrameworkMoniker);
            }

            return(string.Join(";", builder.ToArray()));
        }
        public override async Task <string> OnGetEvaluatedPropertyValueAsync(string evaluatedPropertyValue, IProjectProperties defaultProperties)
        {
            ActiveConfiguredObjects <ConfiguredProject>?configuredProjects = await _projectProvider.GetActiveConfiguredProjectsAsync();

            if (configuredProjects == null)
            {
                return("");
            }

            var builder = PooledArray <string> .GetInstance();

            foreach (ConfiguredProject configuredProject in configuredProjects.Objects)
            {
                ProjectProperties    projectProperties = configuredProject.Services.ExportProvider.GetExportedValue <ProjectProperties>();
                ConfigurationGeneral configuration     = await projectProperties.GetConfigurationGeneralPropertiesAsync();

                string currentTargetFrameworkMoniker = (string)await configuration.TargetFrameworkMoniker.GetValueAsync();

                builder.Add(currentTargetFrameworkMoniker);
            }

            return(string.Join(";", builder.ToArrayAndFree()));
        }
示例#4
0
 public IActiveConfiguredProjectsProviderFactory ImplementGetProjectFrameworksAsync(ActiveConfiguredObjects <ProjectConfiguration> projectConfigurations)
 {
     _mock.Setup(x => x.GetActiveProjectConfigurationsAsync())
     .Returns(Task.FromResult(projectConfigurations));
     return(this);
 }
示例#5
0
 public IActiveConfiguredProjectsProviderFactory ImplementGetActiveConfiguredProjectsAsync(ActiveConfiguredObjects <ConfiguredProject> configuredProjects)
 {
     _mock.Setup(x => x.GetActiveConfiguredProjectsAsync())
     .Returns(Task.FromResult(configuredProjects));
     return(this);
 }