/// <summary> /// Starts a block that scopes an operation that will be written to the currently configured <see cref="ITraceWriter"/> /// after the returned disposable is disposed. /// </summary> /// <remarks> /// If no tracer has been configured for the <see cref="IEquivalencyValidationContext"/>, the call will be ignored. /// </remarks> public IDisposable WriteBlock(GetTraceMessage getTraceMessage) { if (traceWriter is not null) { return(traceWriter.AddBlock(getTraceMessage(currentNode))); } else { return(new Disposable(() => { })); } }