public BuildWhen (XmlElement whenElement, Project parentProject)
		{
			this.parentProject = parentProject;
			this.groupingCollection = new GroupingCollection (parentProject);
			if (whenElement == null)
				throw new ArgumentNullException ("whenElement");
			this.whenElement = whenElement;
			foreach (XmlElement xe in whenElement.ChildNodes) {
				switch (xe.Name) {
					case "ItemGroup":
						BuildItemGroup big = new BuildItemGroup (xe, parentProject, null, true);
						//big.BindToXml (xe);
						groupingCollection.Add (big);
						break;
					case "PropertyGroup":
						BuildPropertyGroup bpg = new BuildPropertyGroup (xe, parentProject, null, true);
						//bpg.BindToXml (xe);
						groupingCollection.Add (bpg);
						break;
					case "Choose":
						BuildChoose bc = new BuildChoose (xe, parentProject);
						groupingCollection.Add (bc);
						break;
					default:
						throw new InvalidProjectFileException ( string.Format ("Invalid element '{0}' in When.", xe.Name));
				}
			}
		}
Esempio n. 2
0
        public BuildWhen(XmlElement whenElement, Project parentProject)
        {
            //this.parentProject = parentProject;
            this.groupingCollection = new GroupingCollection(parentProject);
            if (whenElement == null)
            {
                throw new ArgumentNullException("whenElement");
            }
            this.whenElement = whenElement;
            foreach (XmlElement xe in whenElement.ChildNodes)
            {
                switch (xe.Name)
                {
                case "ItemGroup":
                    BuildItemGroup big = new BuildItemGroup(xe, parentProject, null, true);
                    //big.BindToXml (xe);
                    groupingCollection.Add(big);
                    break;

                case "PropertyGroup":
                    BuildPropertyGroup bpg = new BuildPropertyGroup(xe, parentProject, null, true);
                    //bpg.BindToXml (xe);
                    groupingCollection.Add(bpg);
                    break;

                case "Choose":
                    BuildChoose bc = new BuildChoose(xe, parentProject);
                    groupingCollection.Add(bc);
                    break;

                default:
                    throw new InvalidProjectFileException(string.Format("Invalid element '{0}' in When.", xe.Name));
                }
            }
        }
Esempio n. 3
0
 public BuildWhen(XmlElement whenElement, Project parentProject)
 {
     this.parentProject      = parentProject;
     this.groupingCollection = new GroupingCollection(null);
     if (whenElement == null)
     {
         throw new ArgumentNullException("whenElement");
     }
     this.whenElement = whenElement;
     foreach (XmlElement xe in whenElement.ChildNodes)
     {
         if (xe.Name == "ItemGroup")
         {
             BuildItemGroup big = new BuildItemGroup(xe, parentProject, null, true);
             //big.BindToXml (xe);
             groupingCollection.Add(big);
             // FIXME: add nested chooses
         }
         else if (xe.Name == "PropertyGroup")
         {
             BuildPropertyGroup bpg = new BuildPropertyGroup();
             //bpg.BindToXml (xe);
             groupingCollection.Add(bpg);
         }
         else
         {
             throw new InvalidProjectFileException("Invalid element in When.");
         }
     }
 }
Esempio n. 4
0
 internal void Add(Import import)
 {
     if (!filenames.ContainsKey(import.EvaluatedProjectPath))
     {
         groupingCollection.Add(import);
         filenames.Add(import.EvaluatedProjectPath, import);
     }
 }
Esempio n. 5
0
 internal void Add(BuildItemGroup buildItemGroup)
 {
     buildItemGroup.GroupingCollection = this.groupingCollection;
     groupingCollection.Add(buildItemGroup);
 }
 internal void Add(BuildPropertyGroup bpg)
 {
     bpg.GroupingCollection = groupingCollection;
     groupingCollection.Add(bpg);
 }