コード例 #1
0
 private void Client_DataRecieved(object sender, SimpleTCP.Message e)
 {
     if (e.MessageString.Equals("Proceed"))
     {
         ActiveForm.Invoke((MethodInvoker) delegate()
         {
             this.Hide();
             //c.deconnecter();//close connection
             Form1 f = new Form1(client);
             f.Show();//open second form
         });
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: GetScoreSetScore/spp-laba3c
 private void ReadFilterSendThreadMain()
 {
     if (ListBoxFeeds.Items.Count > 0)
     {
         tags.Clear();
         tags = TextBoxTags.Text.Split(' ').ToList();
         Links.Clear();
         ControlClient client = new ControlClient();
         SynItems      items  = client.ProcessFeeds(ListBoxFeeds.Items.Cast <string>().ToArray(), tags.ToArray(), ListBoxRecipients.Items.Cast <string>().ToArray());
         client.Close();
         ListBoxFeedItems.Invoke(new Action(() => ListBoxFeedItems.Items.Clear()));
         ListBoxFeedItems.Invoke(new Action(() => ListBoxFeedItems.Items.AddRange(items.Titles.ToArray())));
         Links.AddRange(items.Links);
         MainTimer.Stop();
         MainTimer.Interval = (double)(1000 * 60 * (NumericUpDownMinutes.Value + NumericUpDownHours.Value * 60 + NumericUpDownDays.Value * 60 * 24));
         MainTimer.Start();
         ActiveForm?.Invoke(new Action(() => ActiveForm.Text = "Mail sent at " + DateTime.Now));
     }
 }
コード例 #3
0
        private async void FormMailTrigger_Load(object sender, EventArgs e)
        {
            MailTrigerHide = false;

            await Task.Run(() =>
            {
                byte n = 1;
                while (true)
                {
                    Thread.Sleep(600);
                    if (ActiveForm != null)
                    {
                        ActiveForm.Invoke(new Action(() => l_autorization.Text += "."));
                        ++n;
                        if (n >= 4)
                        {
                            ActiveForm.Invoke(new Action(() => l_autorization.Text = "log in"));
                            n = 0;
                        }
                    }
                }
            });
        }