public virtual int DeleteCfgsOfCfgName(string name)
{
if (name == null)
throw new ArgumentNullException("name");
if (string.IsNullOrEmpty(name))
throw new ArgumentException("name cannot be null or empty");
// We need to QE/QS the project file
if(!this.ProjectManager.QueryEditProjectFile(false))
{
throw Marshal.GetExceptionForHR(VSConstants.OLE_E_PROMPTSAVECANCELLED);
}
// Verify that this configuration exists
string[] configs = GetPropertiesConditionedOn(ProjectFileConstants.Configuration);
if (!configs.Contains(name, StringComparer.OrdinalIgnoreCase))
return VSConstants.S_OK;
foreach (MSBuild.Project project in GetBuildProjects(true))
{
int hr = DeleteConfiguration(project, name);
if (ErrorHandler.Failed(hr))
return hr;
}
NotifyOnCfgNameDeleted(name);
return VSConstants.S_OK;
}