From f230812765b7add7f95ca96074e86abfecaf14a3 Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Sat, 20 Jun 2020 13:46:52 -0500 Subject: [PATCH] Updates Bug fixes and UI redesigns. --- mdfinder/DBHelper.cs | 18 +- mdfinder/FileRecord.cs | 11 +- .../Localization/Localization.Designer.cs | 9 + mdfinder/Localization/Localization.resx | 3 + mdfinder/MainWindow.xaml | 50 +++- mdfinder/MainWindow.xaml.cs | 258 ++++++++++++++---- 6 files changed, 265 insertions(+), 84 deletions(-) diff --git a/mdfinder/DBHelper.cs b/mdfinder/DBHelper.cs index 685db31..65027c1 100644 --- a/mdfinder/DBHelper.cs +++ b/mdfinder/DBHelper.cs @@ -17,7 +17,7 @@ namespace mdfinder /// The default database file name. private const string DEFAULT_DB_FILE_NAME = "mdfinder.db"; - #endregion + #endregion Members #region Properties @@ -35,7 +35,7 @@ namespace mdfinder } } - #endregion + #endregion Properties #region Constructors @@ -52,7 +52,7 @@ namespace mdfinder this.Database = new LiteDatabase(database); } - #endregion + #endregion Constructors #region Methods @@ -67,11 +67,11 @@ namespace mdfinder this.FileRecordCollection.Upsert(fileRecord); } - /// Removes the file record described by ID. - /// The identifier. - public void RemoveFileRecord(string path) + /// Removes the file record described by its path. + /// The ID of the file. + public void RemoveFileRecord(string id) { - this.FileRecordCollection.Delete(fr => fr.Id == path); + this.FileRecordCollection.Delete(fr => fr.Id == id); } /// Gets the file records in this collection. @@ -99,6 +99,6 @@ namespace mdfinder this.FileRecordCollection.Delete(Query.All()); } - #endregion + #endregion Methods } -} +} \ No newline at end of file diff --git a/mdfinder/FileRecord.cs b/mdfinder/FileRecord.cs index 645c7f4..c532eae 100644 --- a/mdfinder/FileRecord.cs +++ b/mdfinder/FileRecord.cs @@ -28,7 +28,7 @@ namespace mdfinder /// True to keep. private bool keep; - #endregion + #endregion Members #region Properties @@ -122,7 +122,7 @@ namespace mdfinder } } - #endregion + #endregion Properties #region Constructors @@ -142,14 +142,13 @@ namespace mdfinder /// The hash provider. public FileRecord(string path, long size, string hash, string hashProvider) { - this.Id = path; + this.Id = Guid.NewGuid().ToString(); this.Path = new Uri(path); this.Size = size; this.Hash = hash; this.HashProvider = hashProvider; - } - #endregion + #endregion Constructors } -} +} \ No newline at end of file diff --git a/mdfinder/Localization/Localization.Designer.cs b/mdfinder/Localization/Localization.Designer.cs index a1a3e77..796ebce 100644 --- a/mdfinder/Localization/Localization.Designer.cs +++ b/mdfinder/Localization/Localization.Designer.cs @@ -375,6 +375,15 @@ namespace mdfinder.Localization { } } + /// + /// Looks up a localized string similar to Not A Duplicate. + /// + public static string NotDupliateLabel { + get { + return ResourceManager.GetString("NotDupliateLabel", resourceCulture); + } + } + /// /// Looks up a localized string similar to OK. /// diff --git a/mdfinder/Localization/Localization.resx b/mdfinder/Localization/Localization.resx index 950bca9..6627836 100644 --- a/mdfinder/Localization/Localization.resx +++ b/mdfinder/Localization/Localization.resx @@ -282,4 +282,7 @@ Size On Disk: + + Not A Duplicate + \ No newline at end of file diff --git a/mdfinder/MainWindow.xaml b/mdfinder/MainWindow.xaml index 13ec573..efe7618 100644 --- a/mdfinder/MainWindow.xaml +++ b/mdfinder/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:mdfinder="clr-namespace:mdfinder" xmlns:loc="clr-namespace:mdfinder.Localization" mc:Ignorable="d" - Title="{x:Static loc:Localization.Title}" Height="520.293" Width="814.505"> + Title="{x:Static loc:Localization.Title}" Height="520.293" Width="1055.509"> @@ -34,7 +34,6 @@ - @@ -47,7 +46,7 @@ - + @@ -71,6 +70,7 @@ + - + - + + + + @@ -128,8 +150,8 @@ - - + + @@ -144,7 +166,7 @@