new feature: drag'n'drop

This commit is contained in:
Manuel Kamper 2020-10-29 16:32:34 +01:00
parent d017717610
commit 98a5f50776
4 changed files with 29 additions and 5 deletions

View File

@ -74,6 +74,7 @@
//
// Main
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 161);
@ -88,8 +89,10 @@
this.Name = "Main";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MD5 Generator v1.1 | © 2019-2020 by mk0.at";
this.Text = "MD5 Generator v1.2 | © 2019-2020 by mk0.at";
this.Load += new System.EventHandler(this.Main_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Main_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Main_DragEnter);
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -46,5 +46,26 @@ namespace Mk0.Software.MD5Generator
AutoUpdater.ShowSkipButton = false;
AutoUpdater.Start("https://www.kmpr.at/update/md5generator.xml");
}
private void Main_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
private void Main_DragDrop(object sender, DragEventArgs e)
{
string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
if (FileList.Length > 1)
{
MessageBox.Show("Nur eine Datei erlaubt!", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
GenerateMD5(FileList[0]);
}
}
}
}

View File

@ -12,6 +12,7 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@ -23,8 +24,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.1.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<ApplicationVersion>1.2.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]