public async Task Close() { await OnClose.InvokeAsync(true); modalDisplay = "none"; modalClass = ""; showBackdrop = false; }
public async Task Close() { //if (!IsEnabled) return; Show = false; //await Dialog.Close(); await OnClose.InvokeAsync(); await InvokeAsync(StateHasChanged); }
public async Task Close() { ShowModal = false; if (OnClose.HasDelegate) { await OnClose.InvokeAsync(); } StateHasChanged(); }
public void HandleClose(MouseEventArgs args) { isClosing = true; if (OnClose.HasDelegate) { OnClose.InvokeAsync(args); } }
public void Close() { ModalDisplay = "none"; ModalClass = string.Empty; ShowBackdrop = false; OnClose.InvokeAsync(null); StateHasChanged(); }
/// <summary> /// Closes the current <see cref="HeadlessDialog"/> /// </summary> /// <returns></returns> public async Task Close() { Show = false; await OnClose.InvokeAsync(); await dialogPanel.Close(); await clickOffEventHandler.UnregisterElement(dialogPanel); await InvokeAsync(StateHasChanged); }
/// <summary> /// Handles the close callback. /// </summary> /// <param name="args"></param> /// <returns></returns> protected async Task OnCloseHandler(MouseEventArgs args) { _isClosing = true; if (OnClose.HasDelegate) { await OnClose.InvokeAsync(args); } await Task.Delay(300); _isClosed = true; await AfterCloseHandler(args); }
/// <summary> /// Handles the close callback. /// </summary> /// <param name="args"></param> /// <returns></returns> protected async Task OnCloseHandler(MouseEventArgs args) { if (OnClose.HasDelegate) { await OnClose.InvokeAsync(args); } await PlayMotion(); if (AfterClose.HasDelegate) { await AfterClose.InvokeAsync(args); } }
private void Listen() { while (!dispose) { var buffers = new List <byte[]>(); WebSocketReceiveResult msgInfo = null; try { while (!msgInfo?.EndOfMessage ?? true) { var b = new ArraySegment <byte>(new byte[bufferSize]); msgInfo = socket.ReceiveAsync(b, socketTokenSource.Token).Result; var bArray = b.Array; Array.Resize(ref bArray, msgInfo.Count); buffers.Add(bArray); } } catch (AggregateException ex) when(ex.InnerException?.GetType() == typeof(TaskCanceledException)) { OnClose.InvokeAsync(); return; } catch (Exception e1) { OnError?.Invoke(e1); if (!AutoReconnect) { return; } try { socketTokenSource.Token.WaitHandle.WaitOne(1000); ConnectAsync().Wait(); } catch (Exception e2) { OnReconnectFailed.InvokeAsync(); OnError.InvokeAsync(e2); OnClose.InvokeAsync(); } return; } var buffer = new List <byte>(); foreach (var b in buffers) { buffer.AddRange(b); } Task.Run(() => HandleNewMessage(msgInfo, buffer.ToArray())); } OnClose.InvokeAsync(); }
/// <summary> /// Perform the close action. /// </summary> public async Task Close() { Hidden = true; await OnClose.InvokeAsync(true); }
private void HideCloseIcon() { _hideTag = true; OnClose.InvokeAsync(_hideTag); }