private static string GenerateSummaryString(IEnumerable <BuilderStatEntry> statistics) { return(string.Join(Environment.NewLine, statistics .Where(e => BuilderInstanceTracker.IncludeInCount(e.Type)) .Take(10) .Select(e => string.Format("{0}({1})", e.Type.Name, e.Count)) .ToArray())); }
public DisposableAction PushObject(ObjectBuildRecord buildRecord) { if (IsDisposed) { throw new ObjectDisposedException("BuildSession"); } if (!buildRecord.Counted) { if (BuilderInstanceTracker.IncludeInCount(buildRecord.Type)) { ConstructedCount++; } buildRecord.Counted = true; } CurrentObject = CurrentObject.AddChild(buildRecord); _constructedNodes.Add(CurrentObject); return(new DisposableAction(PopObject)); }