Exemplo n.º 1
0
 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()));
 }
Exemplo n.º 2
0
 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));
 }