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)); }