Exemple #1
0
        /// <summary>
        /// Dispatches the <code>RecoveryInitiated</code>
        /// </summary>
        /// <param name="eventArgs">Event arguments</param>
        public void InvokeRecoveryInitiated(RecoveryInitiatedEventArgs eventArgs)
        {
            if (RecoveryInitiated == null)
            {
                Log.LogDebug("Cannot invoke RecoveryInitiated because no event listeners are attached to associated event handler.");
                return;
            }

            var stopwatch = Stopwatch.StartNew();

            try
            {
                RecoveryInitiated(this, eventArgs);
                stopwatch.Stop();
                Log.LogInformation($"Successfully called RecoveryInitiated event. Duration: {stopwatch.ElapsedMilliseconds} ms.");
            }
            catch (Exception ex)
            {
                stopwatch.Stop();
                Log.LogWarning($"Event handler throw an exception while invoking RecoveryInitiated. Exception: {ex.Message}", ex);
            }
        }
Exemple #2
0
 private void OnRecoveryInitiated(object sender, RecoveryInitiatedEventArgs e)
 {
     RecoveryInitiated?.Invoke(this, e);
 }