Inheritance: MSBuildObject, MSBuildPropertySet
示例#1
0
        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);
        }
示例#2
0
        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);
 }
示例#5
0
		void Prune (MSBuildPropertyGroup g)
		{
			if (g != groups [0] && !g.Properties.Any()) {
				// Remove this group since it's now empty
				g.Parent.RemoveGroup (g);
			}
		}
示例#6
0
		public void Add (MSBuildPropertyGroup g)
		{
			groups.Add (g);
		}
示例#7
0
		public void RemoveGroup (MSBuildPropertyGroup grp)
		{
			elemCache.Remove (grp.Element);
			grp.Element.ParentNode.RemoveChild (grp.Element);
		}
示例#8
0
		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;
		}