コード例 #1
0
        private void Adapter_OnSessionNotifyPro(SessionHandler session, SessionNotifyType notify)
        {
            switch (notify)
            {
            case SessionNotifyType.Message:
                _handlerBinder.InvokePacketHandler(session, session.CompletedBuffer.GetMessageHead(), this);
                break;

            case SessionNotifyType.OnReceive:
                break;

            case SessionNotifyType.ContinueTask:
                this.Text = "//远程键盘记录 连接中....";
                break;

            case SessionNotifyType.SessionClosed:
                this.Text = _adapter.TipText;
                break;

            case SessionNotifyType.WindowShow:
                this.Show();
                break;

            case SessionNotifyType.WindowClose:
                _adapter.WindowClosed = true;
                this.Close();
                break;

            default:
                break;
            }
        }
コード例 #2
0
        protected virtual void AdapterNotify(SessionHandler session, SessionNotifyType notify)
        {
            switch (notify)
            {
            case SessionNotifyType.Message:
                this.OnMessage(session, session.CompletedBuffer.GetMessageHead());
                break;

            case SessionNotifyType.OnReceive:
                this.OnReceive(session, session.ReceiveTransferredBytes);
                break;

            case SessionNotifyType.ContinueTask:
                this.ContinueTask(session);
                break;

            case SessionNotifyType.WorkSessionClosed:
                this.SessionClosed(session);
                break;

            case SessionNotifyType.WindowShow:
                this.Show();
                break;

            case SessionNotifyType.WindowClose:
                Adapter.WindowClosed = true;
                this.Close();
                break;

            default:
                break;
            }
        }
コード例 #3
0
        private void Adapter_OnSessionNotifyPro(SessionHandler session, SessionNotifyType notify)
        {
            switch (notify)
            {
            case SessionNotifyType.Message:
                if (_adapter.WindowClosed)
                {
                    return;
                }

                _handlerBinder.InvokePacketHandler(session, session.CompletedBuffer.GetMessageHead(), this);
                break;

            case SessionNotifyType.OnReceive:
                break;

            case SessionNotifyType.ContinueTask:

                this.Text = _title;
                _adapter.SendAsyncMessage(MessageHead.S_VIEDO_GET_DATA);

                break;

            case SessionNotifyType.SessionClosed:
                this.Text = _title + " [" + _adapter.TipText + "]";
                break;

            case SessionNotifyType.WindowShow:
                this.Show();
                break;

            case SessionNotifyType.WindowClose:

                _adapter.WindowClosed = true;
                this.Close();

                break;

            default:
                break;
            }
        }
コード例 #4
0
        private void Adapter_OnSessionNotifyPro(SessionHandler session, SessionNotifyType notify)
        {
            switch (notify)
            {
            case SessionNotifyType.Message:
                if (_adapter.WindowClosed)
                {
                    return;
                }

                this._handlerBinder.InvokePacketHandler(session, session.CompletedBuffer.GetMessageHead(), this);
                break;

            case SessionNotifyType.OnReceive:
                break;

            case SessionNotifyType.ContinueTask:
                _continueTask = true;
                _timer.Start();
                break;

            case SessionNotifyType.SessionClosed:
                _timer.Stop();
                this.Text = _adapter.TipText;
                break;

            case SessionNotifyType.WindowShow:
                this.Show();
                break;

            case SessionNotifyType.WindowClose:
                _adapter.WindowClosed = true;
                this.Close();
                break;

            default:
                break;
            }
        }
コード例 #5
0
        private void Adapter_OnSessionNotifyPro(SessionHandler session, SessionNotifyType notify)
        {
            switch (notify)
            {
            case Notify.SessionNotifyType.Message:
                this.OnMessage(session);
                break;

            case Notify.SessionNotifyType.OnReceive:
                break;

            case Notify.SessionNotifyType.ContinueTask:

                this.Text = "//testApp 重新连接成功..";

                break;

            case Notify.SessionNotifyType.SessionClosed:
                this.Text = _adapter.TipText;
                break;

            case Notify.SessionNotifyType.WindowShow:
                this.Show();
                break;

            case Notify.SessionNotifyType.WindowClose:

                _adapter.WindowClosed = true;
                this.Close();

                break;

            default:
                break;
            }
        }
コード例 #6
0
 public void OnSessionNotify(SessionHandler session, SessionNotifyType type)
 => OnSessionNotifyPro?.Invoke(session, type);