implemented #6

This commit is contained in:
Manuel Kamper 2020-03-22 10:18:02 +01:00
parent 7f6a3d2df9
commit 8537f974d7
5 changed files with 16 additions and 10 deletions

View File

@ -693,7 +693,7 @@
this.MinimumSize = new System.Drawing.Size(983, 605);
this.Name = "Main";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Image Sorter v1.52 | © 2015-2020 by mk0.at";
this.Text = "Image Sorter v1.53 | © 2015-2020 by mk0.at";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing);
this.Load += new System.EventHandler(this.Main_Load);
this.Shown += new System.EventHandler(this.Main_Shown);

View File

@ -470,8 +470,7 @@ namespace Mk0.Software.ImageSorter
/// <returns></returns>
private int GetImageIndex(string image)
{
int index = 0;
index = images.IndexOf(image);
int index = images.IndexOf(image);
return index;
}
@ -645,16 +644,16 @@ namespace Mk0.Software.ImageSorter
try
{
string fullTargetPath = Path.Combine(targetPath, Path.GetFileName(pictureBoxImage.ImageLocation));
string fullTargetPath = Path.Combine(targetPath, CleanFileName(Path.GetFileName(pictureBoxImage.ImageLocation)));
Image myImg = CopyImage.GetCopyImage(pictureBoxImage.ImageLocation);
if (File.Exists(fullTargetPath))
{
using (var form = new Vergleicher("Das zu verschiebende Bild \"" + Path.GetFileName(pictureBoxImage.ImageLocation) + "\"" + "existiert im Zielverzeichnis \"" + btn.Text + "\" bereits." + Environment.NewLine + Environment.NewLine + "Soll eine Kopie angelegt werden? Nein überschreibt die Datei, Abbrechen bricht den Vorgang ab.", pictureBoxImage.ImageLocation, fullTargetPath))
using (var form = new Vergleicher("Das zu verschiebende Bild \"" + CleanFileName(Path.GetFileName(pictureBoxImage.ImageLocation)) + "\"" + "existiert im Zielverzeichnis \"" + btn.Text + "\" bereits." + Environment.NewLine + Environment.NewLine + "Soll eine Kopie angelegt werden? Nein überschreibt die Datei, Abbrechen bricht den Vorgang ab.", pictureBoxImage.ImageLocation, fullTargetPath))
{
var result = form.ShowDialog();
if (result == DialogResult.Yes)
{
fullTargetPath = Path.Combine(targetPath, Path.GetFileNameWithoutExtension(pictureBoxImage.ImageLocation) + Randomize.NumbersAndDigits(5, "_") + Path.GetExtension(pictureBoxImage.ImageLocation));
fullTargetPath = Path.Combine(targetPath, CleanFileName(Path.GetFileNameWithoutExtension(pictureBoxImage.ImageLocation)) + Randomize.NumbersAndDigits(5, "_") + Path.GetExtension(pictureBoxImage.ImageLocation));
}
else if (result == DialogResult.No)
{
@ -703,6 +702,14 @@ namespace Mk0.Software.ImageSorter
}
}
private string CleanFileName(string filename)
{
string fn = filename;
fn = fn.Replace("_crp", "");
fn = fn.Replace("_cut", "");
return fn;
}
/// <summary>
/// Blinkender Button nach erfolgreichem Verschieben
/// </summary>
@ -1288,8 +1295,6 @@ namespace Mk0.Software.ImageSorter
/// <param name="e"></param>
private void Main_KeyDown(object sender, KeyEventArgs e)
{
int x = e.KeyValue;
if (e.KeyCode == Keys.Delete)
{
buttonDeleteImage.PerformClick();

View File

@ -33,7 +33,7 @@
<PublisherName>manuelkamper.com</PublisherName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.52.0.0</ApplicationVersion>
<ApplicationVersion>1.53.0.0</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<ExcludeDeploymentUrl>true</ExcludeDeploymentUrl>
@ -177,6 +177,7 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Mk0.Software.OnlineUpdater.dll" />
<Content Include="Resources\bmp.ico" />
<None Include="Resources\duplicate.png" />
<Content Include="Resources\gif.ico" />

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.52.*")]
[assembly: AssemblyVersion("1.53.*")]
//[assembly: AssemblyFileVersion("1.6.0.0")]