private static string LargestImagePath(string directory, Post post) { string[] files = Directory.GetFiles(directory, "*" + post.Md5 + "*"); string previous = ""; foreach (string file in files) { if (file.Contains(post.Md5 + "." + post.FileExt)) { return file; } if (file.Contains("_meddef." + post.FileExt)) { previous = file; } else if (file.Contains("_lowdef." + post.FileExt)) { if (string.IsNullOrWhiteSpace(previous)) previous = file; } } return string.IsNullOrWhiteSpace(previous) ? null : previous; }
public E621MimicPage(Post post, string imagePath) { _post = post; _imagePath = imagePath; InitializeComponent(); }
public DisplayPhoto(Post post, string directory) { _directory = directory; _post = post; InitializeComponent(); }