public static MSBuildPropertyGroup Merge(MSBuildPropertyGroup g1, MSBuildPropertyGroup g2) { XmlElement elem = g1.Element.OwnerDocument.CreateElement(null, "PropertyGroup", MSBuildProject.Schema); MSBuildPropertyGroup grp = new MSBuildPropertyGroup(elem); foreach (MSBuildProperty prop in g1.Properties) { grp.SetPropertyValue(prop.Name, prop.Value); } foreach (MSBuildProperty prop in g2.Properties) { grp.SetPropertyValue(prop.Name, prop.Value); } return(grp); }
static string LoadProjectTypeGuids(string fileName) { MSBuildProject project = new MSBuildProject(); project.LoadXml(File.ReadAllText(fileName)); MSBuildPropertyGroup globalGroup = project.GetGlobalPropertyGroup(); if (globalGroup == null) { return(null); } return(globalGroup.GetPropertyValue("ProjectTypeGuids")); }
public void Add(MSBuildPropertyGroup g) { groups.Add(g); }
public void RemoveGroup(MSBuildPropertyGroup grp) { elemCache.Remove(grp.Element); grp.Element.ParentNode.RemoveChild(grp.Element); }
void Prune (MSBuildPropertyGroup g) { if (g != groups [0] && !g.Properties.Any()) { // Remove this group since it's now empty g.Parent.RemoveGroup (g); } }
public void Add (MSBuildPropertyGroup g) { groups.Add (g); }
public void RemoveGroup (MSBuildPropertyGroup grp) { elemCache.Remove (grp.Element); grp.Element.ParentNode.RemoveChild (grp.Element); }
MSBuildPropertyGroup GetGroup (XmlElement elem) { MSBuildObject ob; if (elemCache.TryGetValue (elem, out ob)) return (MSBuildPropertyGroup) ob; MSBuildPropertyGroup it = new MSBuildPropertyGroup (this, elem); elemCache [elem] = it; return it; }
public void UnMerge (MSBuildPropertyGroup baseGrp) { foreach (MSBuildProperty prop in baseGrp.Properties) { MSBuildProperty thisProp = GetProperty (prop.Name); if (thisProp != null && prop.Value == thisProp.Value) RemoveProperty (prop.Name); } }
public static MSBuildPropertyGroup Merge (MSBuildPropertyGroup g1, MSBuildPropertyGroup g2) { XmlElement elem = g1.Element.OwnerDocument.CreateElement (null, "PropertyGroup", MSBuildProject.Schema); MSBuildPropertyGroup grp = new MSBuildPropertyGroup (elem); foreach (MSBuildProperty prop in g1.Properties) grp.SetPropertyValue (prop.Name, prop.Value); foreach (MSBuildProperty prop in g2.Properties) grp.SetPropertyValue (prop.Name, prop.Value); return grp; }