本文整理汇总了C#中Expander.ExpandIntoTaskItemsLeaveEscaped方法的典型用法代码示例。如果您正苦于以下问题:C# Expander.ExpandIntoTaskItemsLeaveEscaped方法的具体用法?C# Expander.ExpandIntoTaskItemsLeaveEscaped怎么用?C# Expander.ExpandIntoTaskItemsLeaveEscaped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expander
的用法示例。
在下文中一共展示了Expander.ExpandIntoTaskItemsLeaveEscaped方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpandAllIntoTaskItems1
public void ExpandAllIntoTaskItems1()
{
PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg);
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
ObjectModelHelpers.AssertItemsMatch(@"foo", GetTaskArrayFromItemList(itemsOut));
}
示例2: ExpandAllIntoTaskItems3
public void ExpandAllIntoTaskItems3()
{
ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
List<ProjectItemInstance> ig = new List<ProjectItemInstance>();
ig.Add(new ProjectItemInstance(project, "Compile", "foo.cs", project.FullPath));
ig.Add(new ProjectItemInstance(project, "Compile", "bar.cs", project.FullPath));
List<ProjectItemInstance> ig2 = new List<ProjectItemInstance>();
ig2.Add(new ProjectItemInstance(project, "Resource", "bing.resx", project.FullPath));
ItemDictionary<ProjectItemInstance> itemsByType = new ItemDictionary<ProjectItemInstance>();
itemsByType.ImportItems(ig);
itemsByType.ImportItems(ig2);
Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg, itemsByType);
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo;bar;@(compile);@(resource)", ExpanderOptions.ExpandPropertiesAndItems, MockElementLocation.Instance);
ObjectModelHelpers.AssertItemsMatch(@"
foo
bar
foo.cs
bar.cs
bing.resx
", GetTaskArrayFromItemList(itemsOut));
}
示例3: ExpandAllIntoTaskItemsComplex
public void ExpandAllIntoTaskItemsComplex()
{
ReadOnlyLookup lookup;
StringMetadataTable itemMetadata;
CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata);
Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(lookup, lookup, itemMetadata);
IList<TaskItem> taskItems = expander.ExpandIntoTaskItemsLeaveEscaped(
"@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; " +
"$(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)",
ExpanderOptions.ExpandAll, MockElementLocation.Instance);
// the following items are passed to the TaskItem constructor, and thus their ItemSpecs should be
// in escaped form.
ObjectModelHelpers.AssertItemsMatch(@"
string$(p): ddd=444
dialogs%253b: eee=555
splash.bmp: ccc=333
\jk
l\mno%253bpqr\stu
subdir1\: aaa=111
subdir2\: bbb=222
english_abc%253bdef
ghi
", GetTaskArrayFromItemList(taskItems));
}
示例4: ExpandAllIntoTaskItems4
public void ExpandAllIntoTaskItems4()
{
PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
pg.Set(ProjectPropertyInstance.Create("a", "aaa"));
pg.Set(ProjectPropertyInstance.Create("b", "bbb"));
pg.Set(ProjectPropertyInstance.Create("c", "cc;dd"));
Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg);
IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo$(a);$(b);$(c)", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
ObjectModelHelpers.AssertItemsMatch(@"
fooaaa
bbb
cc
dd
", GetTaskArrayFromItemList(itemsOut));
}