本文整理汇总了C#中ArrayBuilder.All方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayBuilder.All方法的具体用法?C# ArrayBuilder.All怎么用?C# ArrayBuilder.All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayBuilder
的用法示例。
在下文中一共展示了ArrayBuilder.All方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDisplayClassInstances
/// <summary>
/// Return the set of display class instances that can be reached
/// from the given local. A particular display class may be reachable
/// from multiple locals. In those cases, the instance from the
/// shortest path (fewest intermediate fields) is returned.
/// </summary>
private static int GetDisplayClassInstances(
HashSet<NamedTypeSymbol> displayClassTypes,
ArrayBuilder<DisplayClassInstanceAndFields> displayClassInstances,
int depth)
{
Debug.Assert(displayClassInstances.All(p => p.Depth <= depth));
var atDepth = ArrayBuilder<DisplayClassInstanceAndFields>.GetInstance();
atDepth.AddRange(displayClassInstances.Where(p => p.Depth == depth));
Debug.Assert(atDepth.Count > 0);
int n = 0;
foreach (var instance in atDepth)
{
n += GetDisplayClassInstances(displayClassTypes, displayClassInstances, instance);
}
atDepth.Free();
return n;
}