Exemplo n.º 1
0
        public override void ProcessMessage(ParsedMessage parsedMessage)
        {
            base.ProcessMessage(parsedMessage);

            var position         = ParsePosition(parsedMessage);
            var positionDateTime = ParseDateTime(parsedMessage);

            using (var imageStream = new MemoryStream(parsedMessage.Attachments.First().Data))
            {
                imageStream.Seek(0, SeekOrigin.Begin);

                _pictureRepository.AddPictureToAlbum(
                    MailClientConfiguration.Settings.Pictures.AlbumID,
                    imageStream,
                    parsedMessage.Attachments.First().Name,
                    parsedMessage["TITLE"],
                    parsedMessage.Body,
                    positionDateTime,
                    position
                    );
            }
        }
Exemplo n.º 2
0
 protected static DateTime?ParseDateTime(ParsedMessage parsedMessage)
 {
     return(ParseDateTime(parsedMessage, "TIME"));
 }
 private Post GetPost(ParsedMessage parsedMessage)
 {
     return(parsedMessage["POSTID"] != null?_postRepository.Get(parsedMessage["POSTID"]) : _postRepository.Create());
 }