From f6f7e81b61502587402808b7699cd215c084ff3b Mon Sep 17 00:00:00 2001 From: Luca Auer Date: Fri, 25 May 2018 19:05:58 +0200 Subject: [PATCH] Added info about the creation time and date of the current image --- Image sort.UI/MainWindow.xaml | 1 + Image sort.UI/MainWindow.xaml.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Image sort.UI/MainWindow.xaml b/Image sort.UI/MainWindow.xaml index 683914b8..581a39b8 100644 --- a/Image sort.UI/MainWindow.xaml +++ b/Image sort.UI/MainWindow.xaml @@ -180,6 +180,7 @@ + diff --git a/Image sort.UI/MainWindow.xaml.cs b/Image sort.UI/MainWindow.xaml.cs index 1d94f81c..361a4150 100644 --- a/Image sort.UI/MainWindow.xaml.cs +++ b/Image sort.UI/MainWindow.xaml.cs @@ -519,6 +519,8 @@ private void LoadImage(BitmapImage image) FileNameInfo.Text = $"Name: {Path.GetFileNameWithoutExtension(pathToImage)}"; FileTypeInfo.Text = $"Format: {Path.GetExtension(pathToImage)}"; + DateTime creationTime = File.GetCreationTime(pathToImage).ToLocalTime(); + FileCreationTimeInfo.Text = $"Created at: {creationTime.ToLongDateString()} {creationTime.ToShortTimeString()}"; // Calculates the sizes in MB and KB and rounds them to two digits, before filling in the size. FileSizeInfo.Text = $"Size: " + $"{Math.Round(((double)(new FileInfo(pathToImage)).Length) / (1024 * 1024), 2)} MB, " + @@ -537,6 +539,7 @@ private void LoadImage(BitmapImage image) { FileNameInfo.Text = ""; FileTypeInfo.Text = ""; + FileCreationTimeInfo.Text = ""; FileSizeInfo.Text = ""; // Show progress