Ejemplo n.º 1
0
        public bool Shutdown()
        {
            try
            {
                ControlClient.Close();
                DataTransmissionClient.Close();
                StorageDataReadingClient.Close();
                // TODO: Add task cancellation

                return(true);
            }
            catch (Exception)
            {
                return(false);
                //throw;
            }
        }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    if (ControlClient != null)
                    {
                        ControlClient.Close();
                    }

                    if (ControlStream != null)
                    {
                        ControlStream.Close();
                    }
                }
            }

            _disposed = true;
            OnDisposed();
        }