Esempio n. 1
0
        /// <inheritdoc/>
        protected async ValueTask DisposeAsyncCore()
        {
            foreach (var invoker in JSInvokers)
            {
                if (invoker.Value.IsValueCreated)
                {
                    Logger.LogInformation($"Dispose JS invoker: {invoker.Key}.");
                    var value = await invoker.Value.Value.ConfigureAwait(false);

                    await value.DisposeAsync().ConfigureAwait(false);
                }
            }
            JSInvokers.Clear();
        }
Esempio n. 2
0
 /// <inheritdoc/>
 protected void Dispose(bool disposing)
 {
     if (!_disposedValue)
     {
         if (disposing)
         {
             foreach (var invoker in JSInvokers)
             {
                 if (invoker.Value.IsValueCreated)
                 {
                     Logger.LogInformation($"Dispose JS invoker: {invoker.Key}.");
                     (invoker.Value.Value as IDisposable)?.Dispose();
                 }
             }
             JSInvokers.Clear();
         }
         _disposedValue = true;
     }
 }