/// <inheritdoc/> public void Dispose() { if (ParentValidations != null) { // To avoid leaking memory, it's important to detach any event handlers in Dispose() ParentValidations.ClearingAll -= OnClearingAll; ParentValidations.NotifyValidationRemoved(this); } }
/// <inheritdoc/> public void Dispose() { if (ParentValidations is not null) { // To avoid leaking memory, it's important to detach any event handlers in Dispose() ParentValidations.ClearingAll -= OnClearingAll; ParentValidations.NotifyValidationRemoved(this); } cancellationTokenSource?.Dispose(); cancellationTokenSource = null; }