示例#1
0
        private static void ProcessPosts(BoardId boardId, Post[] posts)
        {
            Regex htmlTag = new Regex("<[^>]*>");
            Regex emptySpace = new Regex(@"\s+");
            foreach (var post in posts)
            {
                post.BoardId = boardId;
                if (post.Comment != null)
                {
                    post.CommentPlain = WebUtility.HtmlDecode(emptySpace.Replace(htmlTag.Replace(post.Comment, " "), " "));
                    var fixedNewlines = post.Comment.Replace("<br>", Environment.NewLine);
                    post.CommentParsed = WebUtility.HtmlDecode(htmlTag.Replace(fixedNewlines, ""));
                }

                if (!string.IsNullOrWhiteSpace(post.FileName))
                {
                    post.ThumbnailPath = CreateThumbnailUri(boardId, post.FileName);
                    post.ImagePath = CreateImageUri(boardId, post.FileName, post.FileExtension);
                }
            }
        }
 internal void ShowImage(Post selectPost)
 {
     CurrentImageUrl = selectPost.ImagePath;
 }
 public void OpenThreadImage(ThreadId threadId, Post selectPost)
 {
     var screen = AddOrSelectScreen(x => x.ThreadId.Equals(threadId), () => new ThreadImageModel(threadId));
     screen.ShowImage(selectPost);
 }
 public void OpenThreadImage(ThreadId _threadId, Post clickedPost)
 {
     throw new NotImplementedException();
 }
 internal void ThumbnailClicked(Post clickedPost)
 {
     _navigation.OpenThreadImage(_threadId, clickedPost);
 }
 internal void PostClicked(Post clickedPost)
 {
     _navigation.OpenThread(new ThreadId(clickedPost.BoardId, clickedPost.PostId));
 }