4 instantiations of ProjectImportElement
Microsoft.Build (4)
Construction\ProjectImportElement.cs (2)
147return new ProjectImportElement(element, containingProject) { Project = project }; 162return new ProjectImportElement(element, containingProject)
Evaluation\ProjectParser.cs (1)
469return new ProjectImportElement(element, parent, _project, sdk);
ObjectModelRemoting\LinkedObjectFactory.cs (1)
145return new ProjectImportElement(link);
110 references to ProjectImportElement
Microsoft.Build (64)
Construction\ProjectImportElement.cs (2)
144internal static ProjectImportElement CreateDisconnected(string project, ProjectRootElement containingProject) 154internal static ProjectImportElement CreateImplicit(
Construction\ProjectImportGroupElement.cs (4)
52public ICollection<ProjectImportElement> Imports => GetChildrenOfType<ProjectImportElement>(); 62public ProjectImportElement AddImport(string project) 66ProjectImportElement newImport = ContainingProject.CreateImportElement(project);
Construction\ProjectRootElement.cs (14)
322public ICollection<ProjectImportElement> Imports => new ReadOnlyCollection<ProjectImportElement>(GetAllChildrenOfType<ProjectImportElement>()); 928public ProjectImportElement AddImport(string project) 935ProjectImportElement import; 1248public ProjectImportElement CreateImportElement(string project) 1250return Link != null ? RootLink.CreateImportElement(project) : ProjectImportElement.CreateDisconnected(project, this); 1871/// Creates and returns a list of <see cref="ProjectImportElement"/> nodes which are implicitly 1876internal List<ProjectImportElement> GetImplicitImportNodes(ProjectRootElement currentProjectOrImport) 1878var nodes = new List<ProjectImportElement>(); 1885nodes.Add(ProjectImportElement.CreateImplicit("Sdk.props", currentProjectOrImport, ImplicitImportLocation.Top, referencedSdk, this)); 1886nodes.Add(ProjectImportElement.CreateImplicit("Sdk.targets", currentProjectOrImport, ImplicitImportLocation.Bottom, referencedSdk, this)); 1899nodes.Add(ProjectImportElement.CreateImplicit("Sdk.props", currentProjectOrImport, ImplicitImportLocation.Top, referencedSdk, sdkNode)); 1900nodes.Add(ProjectImportElement.CreateImplicit("Sdk.targets", currentProjectOrImport, ImplicitImportLocation.Bottom, referencedSdk, sdkNode));
Construction\Solution\SolutionProjectGenerator.cs (6)
884ProjectImportElement importBefore = traversalProject.CreateImportElement(@"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportBefore\*"); 887ProjectImportElement importAfter = traversalProject.CreateImportElement(@"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportAfter\*"); 927ProjectImportElement directorySolutionPropsImport = traversalProject.CreateImportElement("$(DirectorySolutionPropsPath)"); 945ProjectImportElement directorySolutionTargetsImport = traversalProject.CreateImportElement("$(DirectorySolutionTargetsPath)"); 954ProjectImportElement importBeforeLocal = traversalProject.CreateImportElement(localFile); 958ProjectImportElement importAfterLocal = traversalProject.CreateImportElement(localFile);
Definition\Project.cs (3)
3920if (!(element is ProjectImportElement import)) 4491public void RecordImport(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated, SdkResult sdkResult) 4500public void RecordImportWithDuplicates(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated)
Definition\ResolvedImport.cs (3)
24internal ResolvedImport(ProjectImportElement importingElement, ProjectRootElement importedProject, int versionEvaluated, SdkResult sdkResult, bool isImported) 38internal ResolvedImport(Project project, ProjectImportElement importingElement, ProjectRootElement importedProject, int versionEvaluated, SdkResult sdkResult) 53public ProjectImportElement ImportingElement { get; }
Evaluation\Evaluator.cs (15)
107private readonly Dictionary<string, ProjectImportElement> _importsSeen; 249_importsSeen = new Dictionary<string, ProjectImportElement>(StringComparer.OrdinalIgnoreCase); 880List<ProjectImportElement> implicitImports = currentProjectOrImport.GetImplicitImportNodes(currentProjectOrImport); 883foreach (var import in implicitImports) 911case ProjectImportElement import: 933foreach (var import in implicitImports) 1385private void EvaluateImportElement(string directoryOfImportingFile, ProjectImportElement importElement) 1416foreach (ProjectImportElement importElement in importGroupElement.Imports) 1496private List<ProjectRootElement> ExpandAndLoadImports(string directoryOfImportingFile, ProjectImportElement importElement, out SdkResult sdkResult) 1678ProjectImportElement importElement, 1968private LoadImportsResult ExpandAndLoadImportsFromUnescapedImportExpression(string directoryOfImportingFile, ProjectImportElement importElement, string unescapedExpression, 2115ProjectImportElement previouslyImportedAt; 2341private bool IntroducesCircularity(string importFileUnescaped, ProjectImportElement importElement) 2450if (element is ProjectPropertyGroupElement || element is ProjectImportElement || element is ProjectImportGroupElement) 2473private void ThrowForImportedProjectWithSearchPathsNotFound(ProjectImportPathMatch searchPathMatch, ProjectImportElement importElement)
Evaluation\IEvaluatorData.cs (2)
291void RecordImport(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated, SdkResult sdkResult); 296void RecordImportWithDuplicates(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated);
Evaluation\LazyItemEvaluator.cs (1)
109if (element is ProjectPropertyGroupElement || element is ProjectImportElement || element is ProjectImportGroupElement)
Evaluation\LazyItemEvaluator.EvaluatorData.cs (2)
299public void RecordImport(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated, SdkResult sdkResult) 304public void RecordImportWithDuplicates(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated)
Evaluation\ProjectParser.cs (2)
436ProjectImportElement item = ParseProjectImportElement(childElement, importGroup); 447private ProjectImportElement ParseProjectImportElement(XmlElementWithLocation element, ProjectElementContainer parent)
Evaluation\PropertyTrackingEvaluatorDataWrapper.cs (2)
162public void RecordImport(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated, SdkResult sdkResult) => _wrapped.RecordImport(importElement, import, versionEvaluated, sdkResult); 163public void RecordImportWithDuplicates(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated) => _wrapped.RecordImportWithDuplicates(importElement, import, versionEvaluated);
Instance\ProjectInstance.cs (2)
1840ProjectImportElement importElement, 1852void IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, ProjectMetadataInstance, ProjectItemDefinitionInstance>.RecordImportWithDuplicates(ProjectImportElement importElement, ProjectRootElement import, int versionEvaluated)
ObjectModelRemoting\ConstructionObjectLinks\ProjectImportElementLink.cs (3)
12/// Allow for creating a local representation to external object of type <see cref="ProjectImportElement"/> 17/// Access to remote <see cref="ProjectImportElement.ImplicitImportLocation"/>. 22/// Access to remote <see cref="ProjectImportElement.OriginalElement"/>.
ObjectModelRemoting\ConstructionObjectLinks\ProjectRootElementLink.cs (1)
78public abstract ProjectImportElement CreateImportElement(string project);
ObjectModelRemoting\LinkedObjectFactory.cs (2)
119public ResolvedImport Create(ProjectImportElement importingElement, ProjectRootElement importedProject, int versionEvaluated, SdkResult sdkResult, bool isImported) 143public ProjectImportElement Create(ProjectImportElementLink link)
Microsoft.Build.Engine.OM.UnitTests (39)
Construction\ConstructionEditing_Tests.cs (4)
2515ProjectImportElement import = project.AddImport("p"); 2527ProjectImportElement import = project.AddImport("p"); 2863var element = ProjectRootElement.Create().AddImportGroup().AddImport("p"); 2874var element = ProjectRootElement.Create().AddImportGroup().AddImport("p");
Construction\ProjectImportElement_Tests.cs (7)
101List<ProjectImportElement> imports = Helpers.MakeList(project.Imports); 124ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(project.Children); 146ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(project.Children); 180ProjectImportElement import = Helpers.GetFirst(project.Xml.Imports); 219ProjectImportElement import = Helpers.GetFirst(project.Xml.Imports);
Construction\ProjectImportGroupElement_Tests.cs (6)
267List<ProjectImportElement> imports = Helpers.MakeList(project.Imports); 299List<ProjectImportElement> imports = Helpers.MakeList(project.Imports); 333ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(importGroup.Imports); 360ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(importGroup.Imports);
Definition\Project_Tests.cs (8)
3901var import = pre.AddImport(@"$(MSBuildExtensionsPath)\Foo"); 3938var import = pre.AddImport(@"Foo\*"); 3982var import = pre.AddImport(importFile.Path); 4029var import = pre.AddImport(importFile.Path); 4069var import = pre.AddImport("$(SomethingThatEvaluatesToEmpty)"); 4112var import = pre.AddImport(importPath); 4155var import = pre.AddImport(importGlob); 4206var import = pre2.AddImport(pre1.FullPath);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
824public static void Verify(ProjectImportElement viewXml, ProjectImportElement realXml, ValidationContext context = null)
ObjectModelRemoting\Helpers\ViewValidation.cs (1)
199if (VerifyCheckType<ProjectImportElement>(view, real, context, Verify))
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (4)
79xmlPair.Add2NewChildrenWithVerify<ProjectImportElement>(newImport, (p, i) => p.AddImport(i), (pi, i) => pi.Project == i, out var import1, out var import2); 104xmlPair.CreateWithVerify<ProjectImportElement>((p) => p.CreateImportElement("fooImport")); 584var import = xmlPair.AddNewChaildWithVerify<ProjectImportElement>(ObjectType.View, "import", (p, s) => p.AddImport(s), (pe, s) => true); 602importGroup.Add2NewChildrenWithVerify<ProjectImportElement>("projFile", (ig, prj) => ig.AddImport(prj), (i, prj) => i.Project == prj, out var imp1, out var imp2);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectImportElementLink.cs (2)
14public ProjectImportElement ImportElementXml => (ProjectImportElement)Source;
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectRootElementLink.cs (2)
212public override ProjectImportElement CreateImportElement(string project) 214return (ProjectImportElement)this.Proxy.CreateImportElement(project).Import(this.Linker);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (1)
54ElementInfo.New<ProjectImportElement , MockProjectImportElementLinkRemoter>(),
ObjectModelRemoting\RemoteProjectsProviderMock\DirectlyRemotedClasses.cs (2)
46var importElement = (ProjectImportElement)importer.Import<ProjectElement, MockProjectImportElementLinkRemoter>(this.ImportingElement);
Microsoft.Build.Engine.UnitTests (7)
Construction\ProjectImportElement_Tests.cs (3)
30ProjectImportElement importElement = rootElement.Imports.First(); 67ProjectImportElement importElement = rootElement.Imports.First(); 101ProjectImportElement importElement = rootElement.AddImport("Sdk.props");
Evaluation\ProjectSdkImplicitImport_Tests.cs (4)
447var importElement = project.Imports[0].ImportingElement; 528var importingElement = import.ImportingElement; 834private SdkReference GetParsedSdk(ProjectImportElement element) 836PropertyInfo parsedSdkInfo = typeof(ProjectImportElement).GetProperty("SdkReference", BindingFlags.Instance | BindingFlags.NonPublic);