internal Image(FChan.Library.Post post) { InitializeComponent(); if (post.FileExtension == ".webm") { MessageBox.Show("Webm playback is currently not supported.", "Webm not supported", MessageBoxButton.OK, MessageBoxImage.Hand); this.Close(); return; } Post = post; this.Width = (double)Post.ImageWidth + 20; this.Height = (double)Post.ImageHeight + 10; if (Post.ImageWidth >= System.Windows.SystemParameters.PrimaryScreenWidth) { scr.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible; WindowState = WindowState.Maximized; } this.image.Height = (double)Post.ImageHeight; this.image.Width = (double)Post.ImageWidth; string imagename = Post.FileName + Post.FileExtension; ImageSource source = Controller.GetFullImage(Post.Board, imagename); image.HorizontalAlignment = HorizontalAlignment.Left; this.image.Source = source; this.Title = imagename; this.Show(); }
public OP(FChan.Library.Post post) : this() { this.post = post; image.Source = Controller.GetThumbnail(post.Board, post.FileName); name.Content = WebUtility.HtmlDecode($"[{post.Name}] {post.Subject}"); number.Content = $"[{post.PostNumber}]"; comment.Text = ""; List<Run> inlines = Controller.FormatTextInline(post.Comment); foreach (Run inline in inlines) { comment.Inlines.Add(inline); } }
private void SpawnOp(FChan.Library.Post OP) { Jackie4Chuan.OP opControl = new Jackie4Chuan.OP(OP); postStackPanel.Children.Add(opControl); }