static XmlElement AddImportElement( this MSBuildProject project, string importedProjectFile, ProjectImportLocation importLocation) { if (importLocation == ProjectImportLocation.Top) { return project.AddImportElementAtTop (importedProjectFile); } XmlElement import = project.CreateImportElement (importedProjectFile); project.Document.DocumentElement.AppendChild (import); return import; }
static XmlElement AddImportElementAtTop (this MSBuildProject project, string importedProjectFile) { XmlElement import = project.CreateImportElement (importedProjectFile); XmlElement projectRoot = project.Document.DocumentElement; projectRoot.InsertBefore (import, projectRoot.FirstChild); return import; }