[xbuild] Add new reserved properties $(MSBuildThisFile*).
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / BuildChoose.cs
index 7abb245ea0a737ecc197cea3c9c08728c3576f00..7cf3632ec4a00beeec00b5b396dcff95ee188a0e 100644 (file)
@@ -36,13 +36,20 @@ namespace Microsoft.Build.BuildEngine {
                
                BuildWhen       otherwise;
                Project         project;
+               ImportedProject importedProject;
                XmlElement      xmlElement;
                List <BuildWhen>        whens;
                
                public BuildChoose (XmlElement xmlElement, Project project)
+                       : this (xmlElement, project, null)
+               {
+               }
+
+               internal BuildChoose (XmlElement xmlElement, Project project, ImportedProject importedProject)
                {
                        this.xmlElement = xmlElement;
                        this.project = project;
+                       this.importedProject = importedProject;
                        this.whens = new List <BuildWhen> ();
 
                        foreach (XmlNode xn in xmlElement.ChildNodes) {
@@ -65,6 +72,9 @@ namespace Microsoft.Build.BuildEngine {
                                        otherwise = new BuildWhen (xe, project);
                                }
                        }
+
+                       DefinedInFileName = importedProject != null ? importedProject.FullFileName :
+                                               project != null ? project.FullFileName : null;
                }
                
                public void Evaluate ()
@@ -85,6 +95,8 @@ namespace Microsoft.Build.BuildEngine {
                        get { return whens; }
                        set { whens = value; }
                }
+
+               internal string DefinedInFileName { get; private set; }
        }
 }