public static Task ReceiveQueueResult(string requestId, SweetAlertQueueResult result) { var requestGuid = Guid.Parse(requestId); PendingQueueRequests.TryGetValue(requestGuid, out TaskCompletionSource <SweetAlertQueueResult> pendingTask); PendingQueueRequests.Remove(requestGuid); pendingTask.SetResult(result); return(Task.CompletedTask); }
/// <summary> /// Closes the currently open SweetAlert2 modal programmatically. /// </summary> /// <param name="result">The promise originally returned by <code>Swal.FireAsync()</code> will be resolved with this value. /// <para>If no object is given, the promise is resolved with an empty ({}) <code>SweetAlertResult</code> object.</para> /// </param> public async Task CloseAsync(SweetAlertQueueResult result) { await jSRuntime.InvokeAsync <object>($"{JS_NAMESPACE}.CloseResult", result).ConfigureAwait(false); }
/// <summary> /// Closes the currently open SweetAlert2 modal programmatically. /// </summary> /// <param name="result">The promise originally returned by <code>Swal.FireAsync()</code> will be resolved with this value. /// <para>If no object is given, the promise is resolved with an empty ({}) <code>SweetAlertResult</code> object.</para> /// </param> public Task CloseAsync(SweetAlertQueueResult result) { return(this.swal.CloseAsync(result)); }