本文整理汇总了C#中Microsoft.Build.BuildEngine.BuildItemGroup.RemoveItems方法的典型用法代码示例。如果您正苦于以下问题:C# BuildItemGroup.RemoveItems方法的具体用法?C# BuildItemGroup.RemoveItems怎么用?C# BuildItemGroup.RemoveItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.BuildItemGroup
的用法示例。
在下文中一共展示了BuildItemGroup.RemoveItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetItems
//.........这里部分代码省略.........
{
allAdds = CreateItemGroupIfNecessary(allAdds);
allAdds.ImportItems(adds);
}
}
// Accumulate removes while we look downwards
if (entry.Removes != null)
{
BuildItemGroup removes = (BuildItemGroup)entry.Removes[name];
if (removes != null)
{
allRemoves = CreateItemGroupIfNecessary(allRemoves);
allRemoves.ImportItems(removes);
}
}
// Accumulate modifications as we look downwards
if (entry.Modifies != null)
{
Dictionary<BuildItem, Dictionary<string, string>> modifies;
if (entry.Modifies.TryGetValue(name, out modifies))
{
if (allModifies == null)
{
allModifies = new Dictionary<BuildItem, Dictionary<string, string>>();
}
// We already have some modifies for this type
foreach (KeyValuePair<BuildItem, Dictionary<string, string>> modify in modifies)
{
// If earlier scopes modify the same metadata on the same item,
// they have priority
MergeModificationsIntoModificationTable(allModifies, modify, ModifyMergeType.FirstWins);
}
}
}
if (entry.Items != null)
{
groupFound = (BuildItemGroup)entry.Items[name];
if (groupFound != null)
{
// Found a group: we go no further
break;
}
}
if (entry.TruncateLookupsAtThisScope)
{
break;
}
}
if ((allAdds == null || allAdds.Count == 0) &&
(allRemoves == null || allRemoves.Count == 0) &&
(allModifies == null || allModifies.Count == 0))
{
// We can just hand out this group verbatim -
// that avoids any importing
if (groupFound == null)
{
groupFound = new BuildItemGroup();
}
return groupFound;
}
// We have adds and/or removes and/or modifies to incorporate.
// We can't modify the group, because that might
// be visible to other batches; we have to create
// a new one.
BuildItemGroup result = new BuildItemGroup();
if (groupFound != null)
{
result.ImportItems(groupFound);
}
// Removes are processed after adds; this means when we remove there's no need to concern ourselves
// with the case where the item being removed is in an add table somewhere. The converse case is not possible
// using a project file: a project file cannot create an item that was already removed, it can only create
// a unique new item.
if (allAdds != null)
{
result.ImportItems(allAdds);
}
if (allRemoves != null)
{
result.RemoveItems(allRemoves);
}
// Modifies can be processed last; if a modified item was removed, the modify will be ignored
if (allModifies != null)
{
ApplyModifies(result, allModifies);
}
return result;
}