Example #1
0
        private void sendButton_Click(object sender, System.EventArgs e)
        {
            var dialog = new AdressesDialog();
            dialog.ShowDialog();

            if (dialog.DialogResult == DialogResult.OK)
            {
                try
                {
                    var addresses = dialog.Addresses;
                    var client = new NewsletterServiceClient();
                    Task.Factory.StartNew(async () => await client.SendNewsItemsAsync(feedGetter(), addresses));
                    //client.SendNewsItems(feedGetter(), addresses);
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Example #2
0
        private void sendButton_Click(object sender, System.EventArgs e)
        {
            var dialog = new AdressesDialog();

            dialog.ShowDialog();

            if (dialog.DialogResult == DialogResult.OK)
            {
                try
                {
                    var addresses = dialog.Addresses;
                    var client    = new NewsletterServiceClient();
                    Task.Factory.StartNew(async() => await client.SendNewsItemsAsync(feedGetter(), addresses));
                    //client.SendNewsItems(feedGetter(), addresses);
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }