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