示例#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!");
                }
            }));
        }
示例#2
0
 private void DisableService()
 {
     Invoke(new Action(() =>
     {
         if (IsPopRunning)
         {
             Service.RequestStopService();
         }
         ButtonConnectPop.Text = "Start client";
         TimerPopRefresh.Stop();
         ButtonConfig.Enabled = true;
         ListboxLog.Items.Add("Inbox refresh disabled. Messages received since service started: " + NewMessageCounter.ToString());
         ListboxLog.SelectedIndex = ListboxLog.Items.Count - 1;
     }));
 }