Exemplo n.º 1
0
        private static bool RemoveGlobalProperty(Microsoft.Build.Evaluation.Project project, String name)
        {
            ProjectPropertyGroupElement globals  = project.Xml.PropertyGroups.FirstOrDefault(p => p.Label.Equals("Globals"));
            ProjectPropertyElement      property = globals.Properties.FirstOrDefault(p => p.Name.Equals(name));

            if (property != null)
            {
                globals.RemoveChild(property);
                return(true);
            }
            return(false);
        }
        private static bool RemoveGlobalProperty(Microsoft.Build.Evaluation.Project project, string name)
        {
            ProjectPropertyGroupElement globals = project.Xml.PropertyGroups.FirstOrDefault(
                p => p.Label.Equals("Globals", StringComparison.CurrentCultureIgnoreCase));
            ProjectPropertyElement property = globals.Properties.FirstOrDefault(
                p => p.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase));

            if (property != null)
            {
                DTEUtil.EnsureFileIsCheckout(project.FullPath);
                globals.RemoveChild(property);
                return(true);
            }
            return(false);
        }