Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RestMSMessage"/> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public RestMSMessage(Message message)
 {
     Address = message.Address.Value;
     MessageId = message.MessageId.ToString();
     ReplyTo = message.ReplyTo == null ? "" : message.ReplyTo.AbsoluteUri;
     Feed = message.FeedHref.AbsoluteUri;
     Headers = message.Headers.All.Select(header => new RestMSMessageHeader(header)).ToArray();
     Content = new RestMSMessageContent(message.Content);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RestMSMessage"/> class.
 /// </summary>
 /// <param name="message">The message.</param>
 public RestMSMessage(Message message)
 {
     Address   = message.Address.Value;
     MessageId = message.MessageId.ToString();
     ReplyTo   = message.ReplyTo == null ? "" : message.ReplyTo.AbsoluteUri;
     Feed      = message.FeedHref.AbsoluteUri;
     Headers   = message.Headers.All.Select(header => new RestMSMessageHeader(header)).ToArray();
     Content   = new RestMSMessageContent(message.Content);
 }
Ejemplo n.º 3
0
 private Attachment GetAttachmentFromMessage(RestMSMessageContent content)
 {
     return Attachment.CreateAttachmentFromString(
         content.Value,
         Guid.NewGuid().ToString(),
         Encoding.GetEncoding(content.Encoding),
         content.Type);
 }