本文整理汇总了C#中ProjectItems.FindItem方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectItems.FindItem方法的具体用法?C# ProjectItems.FindItem怎么用?C# ProjectItems.FindItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectItems
的用法示例。
在下文中一共展示了ProjectItems.FindItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFolder
private static ProjectItem CreateFolder(ProjectItems currentItems, string container)
{
var folderName = container;
int index = 1;
// Keep looking for a unique name as long as we collide with some item.
// NOTE(cyrusn): There shouldn't be a race condition here. While it looks like a rogue
// component could stomp on the name we've found once we've decided on it, they really
// can't since we're running on the main thread. And, if someone does stomp on us
// somehow, then we really should just throw in that case.
while (currentItems.FindItem(folderName, StringComparer.OrdinalIgnoreCase) != null)
{
folderName = container + index;
index++;
}
return currentItems.AddFolder(folderName);
}