Microsoft.VisualStudio.Project.ConfigProvider.DeleteCfgsOfPlatformName C# (CSharp) Method

DeleteCfgsOfPlatformName() public method

Deletes a specified platform name.
public DeleteCfgsOfPlatformName ( string platName ) : int
platName string The platform name to delete.
return int
        public virtual int DeleteCfgsOfPlatformName(string platName)
        {
            if (platName == null)
                throw new ArgumentNullException("platName");
            if (string.IsNullOrEmpty(platName))
                throw new ArgumentException("platName 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[] platforms = GetPlatformsFromProject();
            if (!platforms.Contains(platName, StringComparer.OrdinalIgnoreCase))
                return VSConstants.S_OK;

            foreach (MSBuild.Project project in GetBuildProjects(true))
            {
                int hr = DeletePlatform(project, platName);
                if (ErrorHandler.Failed(hr))
                    return hr;
            }

            NotifyOnPlatformNameDeleted(platName);
            return VSConstants.S_OK;
        }