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