public override void ForEach(IBaseObjectCallback <IColShape> baseObjectCallback) { foreach (var baseObject in GetAllObjects()) { using var baseObjectRef = new ColShapeRef(baseObject); if (!baseObjectRef.Exists) { continue; } baseObjectRef.DebugCountUp(); baseObjectCallback.OnBaseObject(baseObject); baseObjectRef.DebugCountDown(); } }
public override void OnColShapeEvent(IColShape colShape, IEntity entity, bool state) { base.OnColShapeEvent(colShape, entity, state); if (!ColShapeAsyncDelegateHandlers.HasEvents()) { return; } var colShapeReference = new ColShapeRef(colShape); var baseObjectRef = new BaseObjectRef(entity); Task.Run(async() => { colShapeReference.DebugCountUp(); baseObjectRef.DebugCountUp(); await ColShapeAsyncDelegateHandlers.CallAsync(@delegate => @delegate(colShape, entity, state)); baseObjectRef.DebugCountDown(); colShapeReference.DebugCountDown(); baseObjectRef.Dispose(); colShapeReference.Dispose(); }); }