/// <summary> /// Initializes a new instance of the <see cref="Message"/> class. /// </summary> /// <param name="address">The address.</param> /// <param name="headers"></param> /// <param name="attachment"></param> /// <param name="replyTo"></param> public Message(Address address, Uri feedHref, NameValueCollection headers, Attachment attachment, Uri replyTo = null) { Address = address; ReplyTo = replyTo; MessageId = Guid.NewGuid(); Headers = new MessageHeaders(); var keys = headers.AllKeys; keys.Each(key => Headers.AddHeader(key, headers[key])); Content = new MessageContent(attachment.ContentType, attachment.TransferEncoding, attachment.ContentStream); FeedHref = feedHref; Name = new Name(MessageId.ToString()); ReplyTo = replyTo; }
public RestMSMessageContent(MessageContent content) { Encoding = content.Encoding.ToString(); Type = content.ContentType.ToString(); Value = content.AsString(); }