From b6fc9beb861ad3bf92c91c053cde975d33a34593 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 3 Nov 2021 00:31:50 +0000 Subject: [PATCH] Added: filename in title --- AppResource.Designer.cs | 9 +++++++++ AppResource.resx | 3 +++ MainForm.cs | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/AppResource.Designer.cs b/AppResource.Designer.cs index 0f0121e..a8c3e5c 100644 --- a/AppResource.Designer.cs +++ b/AppResource.Designer.cs @@ -60,6 +60,15 @@ namespace VideoPreview { } } + /// + /// Looks up a localized string similar to Video Preview. + /// + internal static string AppName { + get { + return ResourceManager.GetString("AppName", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/AppResource.resx b/AppResource.resx index 499f667..b87f38c 100644 --- a/AppResource.resx +++ b/AppResource.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Video Preview + Resources\loading-block.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/MainForm.cs b/MainForm.cs index 9260830..de8f890 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -99,6 +99,9 @@ namespace VideoPreview /// private async void button3_MouseClick(object sender, MouseEventArgs e) { + if (this.IsBusy) return; + if (string.IsNullOrWhiteSpace(textBox1.Text)) return; + await ReadVideoFile(textBox1.Text); } @@ -166,6 +169,7 @@ namespace VideoPreview videoFilename = null; videoDuration = TimeSpan.FromSeconds(0); + ThreadControl.SetText(this, AppResource.AppName); textBox1.Text = string.Empty; ThreadControl.SetText(label5, "-"); ThreadControl.SetText(label7, "-"); @@ -279,6 +283,8 @@ namespace VideoPreview videoFilename = filename; videoDuration = inputFile.Metadata.Duration; + ThreadControl.SetText(this, Path.GetFileName(filename) + " - " + AppResource.AppName); + textBox1.Text = videoFilename; ThreadControl.SetText(label5, inputFile.Metadata.VideoData.Format ?? string.Empty); ThreadControl.SetText(label7, (inputFile.Metadata.VideoData.FrameSize ?? string.Empty) + " @ " + inputFile.Metadata.VideoData.Fps.ToString() + "FPS");