Beispiel #1
0
        private void OnPopConnectionClosed(bool CleanShutdown)
        {
            ButtonConnectPop.Invoke(new Action(() =>
            {
                IsPopRunning = false;
                if (!CleanShutdown)
                {
                    ButtonConnectPop.Enabled = true;
                    TimerPopRefresh.Stop();
                    ButtonConfig.Enabled = true;
                }

                ButtonConnectPop.Text = CleanShutdown
                ? "Waiting..."
                : "Start client";

                ListboxLog.Items.Add(CleanShutdown
                    ? "-- connection ended --"
                    : "-- connection failed --");
                ListboxLog.Items.Add("Messages received in this ping: " + FetchMessageCounter.ToString());
                ListboxLog.SelectedIndex = ListboxLog.Items.Count - 1;
                if (FetchMessageCounter > 0)
                {
                    MessageBox.Show("You have " + FetchMessageCounter.ToString() + " new messages!");
                }
            }));
        }
Beispiel #2
0
        private void OnPopConnectionEstablished()
        {
            IsPopRunning = true;
            ButtonConnectPop.Invoke(new Action(() =>
            {
                ButtonConnectPop.Enabled = true;
                ButtonConnectPop.Text    = "Stop client";
                ListboxLog.Items.Add("-- connection started --");
                ListboxLog.SelectedIndex = ListboxLog.Items.Count - 1;
            }));

            PcAuthorize AuthCmd = new PcAuthorize();

            AuthCmd.OnUserLoginSuccess += OnPopUserLoggedIn;
            AuthCmd.OnUserLoginFailed  += OnPopUserFailedToAuth;
            Service.PushNewCommand(AuthCmd);
        }