/// <summary>
        /// Post Message from User Input
        /// </summary>
        private void btnPost_Click(object sender, EventArgs e)
        {
            //Create Message from Client Input
            var message = new messagerequest
            {
                From = new address {
                    Type = addresstype.Direct, Value = messageControl.From
                },
                To          = parseAddress(messageControl.To),
                CC          = parseAddress(messageControl.CC),
                Subject     = messageControl.Subject,
                Body        = messageControl.Body,
                Attachments = attachmentControl.Attachments
            };

            Cursor = Cursors.WaitCursor;
            try
            {
                // Post service call
                var guid = SendMessageHelper.Post(message, getCertificate());

                //Update UI with returned guid
                tbResults.Text           = string.Format("Successful Message Post.\r\nMessage Id = {0}", guid);
                messageControl.MessageId = guid.ToString();
            }
            catch (Exception exception)
            {
                tbResults.Text = string.Empty;
                SecureMessagingHelper.ShowErrorForm(exception);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
 /// <summary>
 /// Calls the Post method of Send Message Service
 /// </summary>
 /// <param name="message">Message for Transmission</param>
 /// <param name="certificate">Client Certificate</param>
 /// <returns>Guid of Queued Message.</returns>
 public static Guid Post(messagerequest message, X509Certificate2 certificate)
 {
     using (var client = getSendMessageClient(certificate))
     {
         return client.post(message);
     }
 }
示例#3
0
 /// <summary>
 /// Calls the Post method of Send Message Service
 /// </summary>
 /// <param name="message">Message for Transmission</param>
 /// <param name="certificate">Client Certificate</param>
 /// <returns>Guid of Queued Message.</returns>
 public static Guid Post(messagerequest message, X509Certificate2 certificate)
 {
     using (var client = getSendMessageClient(certificate))
     {
         return(client.post(message));
     }
 }
        /// <summary>
        /// Post Message from User Input
        /// </summary>
        private void btnPost_Click(object sender, EventArgs e)
        {
            //Create Message from Client Input
            var message = new messagerequest
            {
                From = new address { Type = addresstype.Direct, Value = messageControl.From },
                To = parseAddress(messageControl.To),
                CC = parseAddress(messageControl.CC),
                Subject = messageControl.Subject,
                Body = messageControl.Body,
                Attachments = attachmentControl.Attachments
            };

            Cursor = Cursors.WaitCursor;
            try
            {
                // Post service call
                var guid = SendMessageHelper.Post(message, getCertificate());

                //Update UI with returned guid
                tbResults.Text = string.Format("Successful Message Post.\r\nMessage Id = {0}", guid);
                messageControl.MessageId = guid.ToString();
            }
            catch (Exception exception)
            {
                tbResults.Text = string.Empty;
                SecureMessagingHelper.ShowErrorForm(exception);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }