/// <summary> /// Adds a configuration to the project. /// </summary> /// <param name="unconfiguredProject">Unconfigured project for which the configuration change.</param> /// <param name="configurationName">Name of the new configuration.</param> /// <returns>A task for the async operation.</returns> private async Task OnConfigurationAddedAsync(UnconfiguredProject unconfiguredProject, string configurationName) { string evaluatedPropertyValue = await GetPropertyValue(unconfiguredProject).ConfigureAwait(false); await ProjectXmlAccessor.ExecuteInWriteLock(msbuildProject => { BuildUtilities.AppendPropertyValue(msbuildProject, evaluatedPropertyValue, PropertyName, configurationName); }).ConfigureAwait(false); }
/// <summary> /// Removes a platform from the project. /// </summary> /// <param name="unconfiguredProject">Unconfigured project for which the configuration change.</param> /// <param name="platformName">Name of the deleted platform.</param> /// <returns>A task for the async operation.</returns> private async Task OnPlatformDeletedAsync(UnconfiguredProject unconfiguredProject, string platformName) { string evaluatedPropertyValue = await GetPropertyValue(unconfiguredProject).ConfigureAwait(false); await ProjectXmlAccessor.ExecuteInWriteLock(msbuildProject => { BuildUtilities.RemovePropertyValue(msbuildProject, evaluatedPropertyValue, PropertyName, platformName); }).ConfigureAwait(false); }
/// <summary> /// Renames an existing configuration in the project. /// </summary> /// <param name="project">Unconfigured project for which the configuration change.</param> /// <param name="oldName">Original name of the configuration.</param> /// <param name="newName">New name of the configuration.</param> /// <returns>A task for the async operation.</returns> private async Task OnConfigurationRenamedAsync(UnconfiguredProject project, string oldName, string newName) { string evaluatedPropertyValue = await GetPropertyValue(project).ConfigureAwait(false); await ProjectXmlAccessor.ExecuteInWriteLock(msbuildProject => { BuildUtilities.RenamePropertyValue(msbuildProject, evaluatedPropertyValue, PropertyName, oldName, newName); }).ConfigureAwait(false); }