Exemplo n.º 1
0
        public async Task Close()
        {
            await OnClose.InvokeAsync(true);

            modalDisplay = "none";
            modalClass   = "";
            showBackdrop = false;
        }
Exemplo n.º 2
0
        public async Task Close()
        {
            //if (!IsEnabled) return;
            Show = false;
            //await Dialog.Close();
            await OnClose.InvokeAsync();

            await InvokeAsync(StateHasChanged);
        }
Exemplo n.º 3
0
 public async Task Close()
 {
     ShowModal = false;
     if (OnClose.HasDelegate)
     {
         await OnClose.InvokeAsync();
     }
     StateHasChanged();
 }
Exemplo n.º 4
0
        public void HandleClose(MouseEventArgs args)
        {
            isClosing = true;

            if (OnClose.HasDelegate)
            {
                OnClose.InvokeAsync(args);
            }
        }
Exemplo n.º 5
0
        public void Close()
        {
            ModalDisplay = "none";
            ModalClass   = string.Empty;
            ShowBackdrop = false;

            OnClose.InvokeAsync(null);

            StateHasChanged();
        }
Exemplo n.º 6
0
        /// <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);
        }
Exemplo n.º 7
0
        /// <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);
        }
Exemplo n.º 8
0
        /// <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);
            }
        }
Exemplo n.º 9
0
        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();
        }
Exemplo n.º 10
0
 /// <summary>
 /// Perform the close action.
 /// </summary>
 public async Task Close()
 {
     Hidden = true;
     await OnClose.InvokeAsync(true);
 }
Exemplo n.º 11
0
 private void HideCloseIcon()
 {
     _hideTag = true;
     OnClose.InvokeAsync(_hideTag);
 }