Compare commits
No commits in common. "master" and "release/0.1.2.027" have entirely different histories.
master
...
release/0.
38
MainForm.Designer.cs
generated
38
MainForm.Designer.cs
generated
@ -53,8 +53,6 @@ namespace VideoPreview
|
||||
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadNextFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@ -73,6 +71,8 @@ namespace VideoPreview
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "File Name";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.label1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
|
||||
this.label1.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
@ -83,6 +83,8 @@ namespace VideoPreview
|
||||
this.label2.TabIndex = 5;
|
||||
this.label2.Text = "-";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.label2.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
|
||||
this.label2.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
@ -116,6 +118,8 @@ namespace VideoPreview
|
||||
this.tHorizontalSeparator1.Size = new System.Drawing.Size(454, 22);
|
||||
this.tHorizontalSeparator1.TabIndex = 9;
|
||||
this.tHorizontalSeparator1.TabStop = false;
|
||||
this.tHorizontalSeparator1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
|
||||
this.tHorizontalSeparator1.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
|
||||
//
|
||||
// tHorizontalSeparator3
|
||||
//
|
||||
@ -146,6 +150,8 @@ namespace VideoPreview
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(433, 540);
|
||||
this.flowLayoutPanel1.TabIndex = 1;
|
||||
this.flowLayoutPanel1.WrapContents = false;
|
||||
this.flowLayoutPanel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
|
||||
this.flowLayoutPanel1.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
@ -192,6 +198,7 @@ namespace VideoPreview
|
||||
this.button2.Size = new System.Drawing.Size(37, 37);
|
||||
this.button2.TabIndex = 2;
|
||||
this.toolTip1.SetToolTip(this.button2, "Options");
|
||||
this.button2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button2_MouseClick);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
@ -208,6 +215,7 @@ namespace VideoPreview
|
||||
this.button3.Size = new System.Drawing.Size(35, 37);
|
||||
this.button3.TabIndex = 3;
|
||||
this.toolTip1.SetToolTip(this.button3, "Refresh");
|
||||
this.button3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button3_MouseClick);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
@ -224,6 +232,7 @@ namespace VideoPreview
|
||||
this.button4.Size = new System.Drawing.Size(37, 37);
|
||||
this.button4.TabIndex = 4;
|
||||
this.toolTip1.SetToolTip(this.button4, "Next");
|
||||
this.button4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button4_MouseClick);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
@ -299,9 +308,7 @@ namespace VideoPreview
|
||||
//
|
||||
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.refreshToolStripMenuItem,
|
||||
this.loadNextFileToolStripMenuItem,
|
||||
this.toolStripSeparator1,
|
||||
this.toolStripMenuItem3});
|
||||
this.loadNextFileToolStripMenuItem});
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
|
||||
this.editToolStripMenuItem.Text = "&Edit";
|
||||
@ -310,7 +317,7 @@ namespace VideoPreview
|
||||
//
|
||||
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
|
||||
this.refreshToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;
|
||||
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
|
||||
this.refreshToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
|
||||
this.refreshToolStripMenuItem.Text = "&Refresh";
|
||||
this.refreshToolStripMenuItem.Click += new System.EventHandler(this.refreshToolStripMenuItem_Click);
|
||||
//
|
||||
@ -318,23 +325,10 @@ namespace VideoPreview
|
||||
//
|
||||
this.loadNextFileToolStripMenuItem.Name = "loadNextFileToolStripMenuItem";
|
||||
this.loadNextFileToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3;
|
||||
this.loadNextFileToolStripMenuItem.Size = new System.Drawing.Size(209, 22);
|
||||
this.loadNextFileToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
|
||||
this.loadNextFileToolStripMenuItem.Text = "&Load Next File";
|
||||
this.loadNextFileToolStripMenuItem.Click += new System.EventHandler(this.loadNextFileToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(206, 6);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F11)));
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(209, 22);
|
||||
this.toolStripMenuItem3.Text = "&Always On Top";
|
||||
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
|
||||
//
|
||||
// toolStripMenuItem2
|
||||
//
|
||||
this.toolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@ -409,6 +403,8 @@ namespace VideoPreview
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "MainForm";
|
||||
this.Text = "Video Preview";
|
||||
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
|
||||
this.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
@ -446,8 +442,6 @@ namespace VideoPreview
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
|
||||
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
|
||||
}
|
||||
}
|
||||
|
||||
|
172
MainForm.cs
172
MainForm.cs
@ -27,10 +27,6 @@ namespace VideoPreview
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
button3.Click += delegate { refreshToolStripMenuItem_Click(null, null); };
|
||||
button4.Click += delegate { loadNextFileToolStripMenuItem_Click(null, null); };
|
||||
button2.Click += delegate { optionsToolStripMenuItem_Click(null, null); };
|
||||
|
||||
button2.SetIcon("settings");
|
||||
button3.SetIcon("refresh-cw");
|
||||
button4.SetIcon("arrow-right-circle");
|
||||
@ -60,17 +56,31 @@ namespace VideoPreview
|
||||
base.OnFormClosing(e);
|
||||
}
|
||||
|
||||
protected override void OnDragOver(DragEventArgs e)
|
||||
{
|
||||
base.OnDragOver(e);
|
||||
|
||||
public bool IsBusy
|
||||
{
|
||||
get => isBusy;
|
||||
set
|
||||
{
|
||||
isBusy = value;
|
||||
|
||||
ThreadControl.SetValue(pictureBox1, (isBusy ? UIcon.GetImage("loading_block") : null));
|
||||
ThreadControl.SetEnable(textBox1, !isBusy);
|
||||
ThreadControl.SetEnable(button1, !isBusy);
|
||||
ThreadControl.SetEnable(button2, !isBusy);
|
||||
ThreadControl.SetEnable(button3, !isBusy);
|
||||
ThreadControl.SetEnable(button4, !isBusy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Form1_DragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None);
|
||||
}
|
||||
|
||||
protected override async void OnDragDrop(DragEventArgs e)
|
||||
private async void Form1_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
base.OnDragDrop(e);
|
||||
|
||||
string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
|
||||
if (fileList == null)
|
||||
{
|
||||
@ -100,101 +110,31 @@ namespace VideoPreview
|
||||
}
|
||||
|
||||
|
||||
public bool IsBusy
|
||||
{
|
||||
get => isBusy;
|
||||
set
|
||||
{
|
||||
isBusy = value;
|
||||
|
||||
ThreadControl.SetValue(pictureBox1, (isBusy ? UIcon.GetImage("loading_block") : null));
|
||||
ThreadControl.SetEnable(textBox1, !isBusy);
|
||||
ThreadControl.SetEnable(button1, !isBusy);
|
||||
ThreadControl.SetEnable(button2, !isBusy);
|
||||
ThreadControl.SetEnable(button3, !isBusy);
|
||||
ThreadControl.SetEnable(button4, !isBusy);
|
||||
}
|
||||
}
|
||||
|
||||
public AppSession CurrentSession { get; set; } = new AppSession();
|
||||
|
||||
|
||||
#region main menu
|
||||
|
||||
/// <summary>
|
||||
/// Refresh
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private async void refreshToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsBusy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(textBox1.Text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await ReadVideoFile(textBox1.Text);
|
||||
}
|
||||
private void refreshToolStripMenuItem_Click(object sender, EventArgs e) => button3_MouseClick(null, null);
|
||||
|
||||
/// <summary>
|
||||
/// Load next file
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private async void loadNextFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsBusy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(textBox1.Text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
string path = AccessibleDirectory.GetNextFile(textBox1.Text, "*.avi;*.mkv;*.mp4;*.ogm;*.mov;*.mpg;*.mpeg");
|
||||
if (string.IsNullOrWhiteSpace(path)) return;
|
||||
|
||||
textBox1.Text = path;
|
||||
});
|
||||
}
|
||||
private void loadNextFileToolStripMenuItem_Click(object sender, EventArgs e) => button4_MouseClick(null, null);
|
||||
|
||||
/// <summary>
|
||||
/// Options
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsBusy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (optionsForm == null) optionsForm = new OptionsForm(this.CurrentSession);
|
||||
if (optionsForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this.CurrentSession = optionsForm.Session;
|
||||
|
||||
this.TopMost = this.CurrentSession.AlwaysOnTop;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Always-On-Top
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void toolStripMenuItem3_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.TopMost = this.CurrentSession.AlwaysOnTop = !this.TopMost;
|
||||
}
|
||||
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) => button2_MouseClick(null, null);
|
||||
|
||||
/// <summary>
|
||||
/// View help
|
||||
@ -227,6 +167,61 @@ namespace VideoPreview
|
||||
MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Refresh
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private async void button3_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.IsBusy) return;
|
||||
if (string.IsNullOrWhiteSpace(textBox1.Text)) return;
|
||||
|
||||
await ReadVideoFile(textBox1.Text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Options
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void button2_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (this.IsBusy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (optionsForm == null) optionsForm = new OptionsForm(this.CurrentSession);
|
||||
if (optionsForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this.CurrentSession = optionsForm.Session;
|
||||
|
||||
this.TopMost = this.CurrentSession.AlwaysOnTop;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Next file
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private async void button4_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
if (this.IsBusy) return;
|
||||
if (string.IsNullOrWhiteSpace(textBox1.Text)) return;
|
||||
|
||||
string path = AccessibleDirectory.GetNextFile(textBox1.Text, "*.avi;*.mkv;*.mp4;*.ogm;*.mov;*.mpg;*.mpeg");
|
||||
if (string.IsNullOrWhiteSpace(path)) return;
|
||||
|
||||
textBox1.Text = path;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Close
|
||||
/// </summary>
|
||||
@ -334,13 +329,10 @@ namespace VideoPreview
|
||||
|
||||
protected async Task ReadVideoFile(string filename)
|
||||
{
|
||||
if (this.IsBusy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
if (this.IsBusy) return;
|
||||
|
||||
this.IsBusy = true;
|
||||
|
||||
Clear();
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows8.0</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<AssemblyName>videopreview</AssemblyName>
|
||||
<Authors>Ray Lam</Authors>
|
||||
@ -11,7 +11,7 @@
|
||||
<Copyright>Ray Lam</Copyright>
|
||||
<ApplicationIcon>favicon.ico</ApplicationIcon>
|
||||
<NoWin32Manifest>true</NoWin32Manifest>
|
||||
<Version>0.1.3.010</Version>
|
||||
<Version>0.1.2.039</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
@ -1,5 +1,5 @@
|
||||
rmdir /s /q "bin\Release\64\"
|
||||
dotnet publish skye.sln -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\64\"
|
||||
|
||||
##rmdir /s /q "bin\Release\86\"
|
||||
##dotnet publish skye.sln -r win-x86 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\86\"
|
||||
rmdir /s /q "bin\Release\86\"
|
||||
dotnet publish skye.sln -r win-x86 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\86\"
|
Loading…
Reference in New Issue
Block a user