BuildIt.Config.Core.Services.ConfigurationHelpers.BlockAppFromRunning C# (CSharp) Method

BlockAppFromRunning() public static method

public static BlockAppFromRunning ( this configurationService, string title, string body, Func retryAction = null ) : Task
configurationService this
title string
body string
retryAction Func
return Task
        public static async Task BlockAppFromRunning(this IAppConfigurationService configurationService, string title, string body, Func<Task> retryAction = null)
        {
            await SemaphoreSlim.WaitAsync();
            try
            {
                await configurationService.UserDialogService.AlertAsync(body, title);
                await Task.Delay(1000);
                retryAction?.Invoke();
            }
            catch (Exception)
            {
                // ignored
            }
            finally
            {
                SemaphoreSlim.Release();
            }
        }
    }