From ac438fd3978399d12d46adac2ddc0b5d21cbbec8 Mon Sep 17 00:00:00 2001 From: Flaky Date: Sat, 28 Mar 2026 17:01:28 +0000 Subject: [PATCH] code cleanup, ensure resources.designer.cs is added to repo + generated --- .../TagDatabase/TagDatabase.Initialisation.cs | 2 +- UI/Assets/Resources.Designer.cs | 863 ------------------ UI/TagHierarchyManager.UI.csproj | 17 +- UI/Views/RecentsWindow.axaml.cs | 3 +- 4 files changed, 13 insertions(+), 872 deletions(-) delete mode 100755 UI/Assets/Resources.Designer.cs diff --git a/Core/Models/TagDatabase/TagDatabase.Initialisation.cs b/Core/Models/TagDatabase/TagDatabase.Initialisation.cs index 79fbd17..a79f711 100644 --- a/Core/Models/TagDatabase/TagDatabase.Initialisation.cs +++ b/Core/Models/TagDatabase/TagDatabase.Initialisation.cs @@ -192,7 +192,7 @@ public partial class TagDatabase ? Path.GetFileNameWithoutExtension(this.currentConnection.DataSource) : InMemoryDbName; - this.PerformNeededMigrations(); + await this.PerformNeededMigrations(); this.Initialised = true; diff --git a/UI/Assets/Resources.Designer.cs b/UI/Assets/Resources.Designer.cs deleted file mode 100755 index c1a047f..0000000 --- a/UI/Assets/Resources.Designer.cs +++ /dev/null @@ -1,863 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TagHierarchyManager.UI.Assets { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TagHierarchyManager.UI.Assets.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to About {0}. - /// - public static string AboutTitleFormat { - get { - return ResourceManager.GetString("AboutTitleFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Add row.... - /// - public static string BulkAddButtonAddRow { - get { - return ResourceManager.GetString("BulkAddButtonAddRow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Delete row(s).... - /// - public static string BulkAddButtonDeleteRow { - get { - return ResourceManager.GetString("BulkAddButtonDeleteRow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} (on row {1}). - /// - public static string BulkAddExceptionTemplate { - get { - return ResourceManager.GetString("BulkAddExceptionTemplate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Add new tag.... - /// - public static string ButtonAdd { - get { - return ResourceManager.GetString("ButtonAdd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Browse.... - /// - public static string ButtonBrowse { - get { - return ResourceManager.GetString("ButtonBrowse", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Add multiple tags.... - /// - public static string ButtonBulkAdd { - get { - return ResourceManager.GetString("ButtonBulkAdd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cancel. - /// - public static string ButtonCancel { - get { - return ResourceManager.GetString("ButtonCancel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Delete. - /// - public static string ButtonDelete { - get { - return ResourceManager.GetString("ButtonDelete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Import. - /// - public static string ButtonImport { - get { - return ResourceManager.GetString("ButtonImport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No. - /// - public static string ButtonNo { - get { - return ResourceManager.GetString("ButtonNo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OK. - /// - public static string ButtonOk { - get { - return ResourceManager.GetString("ButtonOk", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Save. - /// - public static string ButtonSave { - get { - return ResourceManager.GetString("ButtonSave", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search. - /// - public static string ButtonSearch { - get { - return ResourceManager.GetString("ButtonSearch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Yes. - /// - public static string ButtonYes { - get { - return ResourceManager.GetString("ButtonYes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Is top level?. - /// - public static string CheckBoxTopLevel { - get { - return ResourceManager.GetString("CheckBoxTopLevel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (c) Flaky 2025, licensed under MIT. - /// - public static string CopyrightAndLicense { - get { - return ResourceManager.GetString("CopyrightAndLicense", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Version: {0}. - /// - public static string DatabaseSettingsDbVersion { - get { - return ResourceManager.GetString("DatabaseSettingsDbVersion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Default tag bindings:. - /// - public static string DatabaseSettingsDefaultTagBindings { - get { - return ResourceManager.GetString("DatabaseSettingsDefaultTagBindings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tags: {0}, with {1} parent-child relationships. - /// - public static string DatabaseSettingsTagCount { - get { - return ResourceManager.GetString("DatabaseSettingsTagCount", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Choose template to import.... - /// - public static string DialogTitleChooseImportTemplate { - get { - return ResourceManager.GetString("DialogTitleChooseImportTemplate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Export tag database to file.... - /// - public static string DialogTitleExportTagDatabase { - get { - return ResourceManager.GetString("DialogTitleExportTagDatabase", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Open tag database.... - /// - public static string DialogTitleOpenDatabase { - get { - return ResourceManager.GetString("DialogTitleOpenDatabase", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Save tag database file.... - /// - public static string DialogTitleSaveDatabaseAs { - get { - return ResourceManager.GetString("DialogTitleSaveDatabaseAs", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File name cannot be blank.. - /// - public static string ErrorBlankTagName { - get { - return ResourceManager.GetString("ErrorBlankTagName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error has occurred.. - /// - public static string ErrorDialogTitle { - get { - return ResourceManager.GetString("ErrorDialogTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error. - /// - public static string ErrorDialogTitleBarTitle { - get { - return ResourceManager.GetString("ErrorDialogTitleBarTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File type '{0}' is not supported.. - /// - public static string ErrorImportFileTypeNotSupported { - get { - return ResourceManager.GetString("ErrorImportFileTypeNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tags that are not top level must have a parent.. - /// - public static string ErrorOrphanTagAttempt { - get { - return ResourceManager.GetString("ErrorOrphanTagAttempt", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You cannot make tags a parent of themselves.. - /// - public static string ErrorSelfParentAttempt { - get { - return ResourceManager.GetString("ErrorSelfParentAttempt", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MusicBee tag hierarchy template. - /// - public static string FileFormatMusicBeeTagHierarchy { - get { - return ResourceManager.GetString("FileFormatMusicBeeTagHierarchy", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag hierarchy database. - /// - public static string FileFormatTagHierarchyDatabase { - get { - return ResourceManager.GetString("FileFormatTagHierarchyDatabase", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Alias(es). - /// - public static string HeaderAliases { - get { - return ResourceManager.GetString("HeaderAliases", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Date added. - /// - public static string HeaderDateAdded { - get { - return ResourceManager.GetString("HeaderDateAdded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Date modified. - /// - public static string HeaderDateModified { - get { - return ResourceManager.GetString("HeaderDateModified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name. - /// - public static string HeaderName { - get { - return ResourceManager.GetString("HeaderName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Notes. - /// - public static string HeaderNotes { - get { - return ResourceManager.GetString("HeaderNotes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Parent(s). - /// - public static string HeaderParents { - get { - return ResourceManager.GetString("HeaderParents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag binding(s). - /// - public static string HeaderTagBindings { - get { - return ResourceManager.GetString("HeaderTagBindings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Database file to save to:. - /// - public static string ImportDatabaseToSave { - get { - return ResourceManager.GetString("ImportDatabaseToSave", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File to import:. - /// - public static string ImportFileToImport { - get { - return ResourceManager.GetString("ImportFileToImport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No file picked.. - /// - public static string ImportNoFilePicked { - get { - return ResourceManager.GetString("ImportNoFilePicked", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Import failed.. - /// - public static string ImportStatusFailed { - get { - return ResourceManager.GetString("ImportStatusFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Importing.... - /// - public static string ImportStatusInProgress { - get { - return ResourceManager.GetString("ImportStatusInProgress", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Database. - /// - public static string MenuDatabase { - get { - return ResourceManager.GetString("MenuDatabase", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _File. - /// - public static string MenuFile { - get { - return ResourceManager.GetString("MenuFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Help. - /// - public static string MenuHelp { - get { - return ResourceManager.GetString("MenuHelp", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _About. - /// - public static string MenuItemAbout { - get { - return ResourceManager.GetString("MenuItemAbout", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Database _settings. - /// - public static string MenuItemDatabaseSettings { - get { - return ResourceManager.GetString("MenuItemDatabaseSettings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Export. - /// - public static string MenuItemExport { - get { - return ResourceManager.GetString("MenuItemExport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _New from import.... - /// - public static string MenuItemImport { - get { - return ResourceManager.GetString("MenuItemImport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _New database. - /// - public static string MenuItemNewDatabase { - get { - return ResourceManager.GetString("MenuItemNewDatabase", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Open. - /// - public static string MenuItemOpen { - get { - return ResourceManager.GetString("MenuItemOpen", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Quit. - /// - public static string MenuItemQuit { - get { - return ResourceManager.GetString("MenuItemQuit", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Recently added/edited tags. - /// - public static string MenuItemRecents { - get { - return ResourceManager.GetString("MenuItemRecents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Total tags: {0}. - /// - public static string MenuItemTotalTags { - get { - return ResourceManager.GetString("MenuItemTotalTags", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have unsaved changes to the currently loaded tag. Are you sure you want to cancel?. - /// - public static string MessageUnsavedCancel { - get { - return ResourceManager.GetString("MessageUnsavedCancel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NOTE: Only newly added tags will show up on this table. If you have recently migrated, you will not see any tags here.. - /// - public static string RecentsNoteAddedTimestampedOnly { - get { - return ResourceManager.GetString("RecentsNoteAddedTimestampedOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search aliases/A.K.As?. - /// - public static string SearchEnableAliases { - get { - return ResourceManager.GetString("SearchEnableAliases", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ends with.... - /// - public static string SearchModeEndsWith { - get { - return ResourceManager.GetString("SearchModeEndsWith", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Exact match. - /// - public static string SearchModeExactMatch { - get { - return ResourceManager.GetString("SearchModeExactMatch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fuzzy search. - /// - public static string SearchModeFuzzy { - get { - return ResourceManager.GetString("SearchModeFuzzy", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Starts with.... - /// - public static string SearchModeStartsWith { - get { - return ResourceManager.GetString("SearchModeStartsWith", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} tags found.. - /// - public static string SearchMultipleResultsFound { - get { - return ResourceManager.GetString("SearchMultipleResultsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No tags found.. - /// - public static string SearchNoResultsFound { - get { - return ResourceManager.GetString("SearchNoResultsFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to One tag found.. - /// - public static string SearchOneResultFound { - get { - return ResourceManager.GetString("SearchOneResultFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Successfully added {0} tags.. - /// - public static string StatusBlockBulkAddSuccess { - get { - return ResourceManager.GetString("StatusBlockBulkAddSuccess", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to "{0}" loaded successfully.. - /// - public static string StatusBlockDbLoadSuccessful { - get { - return ResourceManager.GetString("StatusBlockDbLoadSuccessful", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Exporting tag hierarchy.... - /// - public static string StatusBlockExportInProgress { - get { - return ResourceManager.GetString("StatusBlockExportInProgress", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Successfully exported at "{0}". - /// - public static string StatusBlockExportSuccessful { - get { - return ResourceManager.GetString("StatusBlockExportSuccessful", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ready.. - /// - public static string StatusBlockReady { - get { - return ResourceManager.GetString("StatusBlockReady", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag "{0}" saved successfully.. - /// - public static string StatusBlockTagSaveSuccessful { - get { - return ResourceManager.GetString("StatusBlockTagSaveSuccessful", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Hierarchy Tree. - /// - public static string TabHierarchyTree { - get { - return ResourceManager.GetString("TabHierarchyTree", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Recently Added. - /// - public static string TabRecentlyAdded { - get { - return ResourceManager.GetString("TabRecentlyAdded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Recently Edited. - /// - public static string TabRecentlyEdited { - get { - return ResourceManager.GetString("TabRecentlyEdited", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Search. - /// - public static string TabSearch { - get { - return ResourceManager.GetString("TabSearch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag Hierarchy Manager. - /// - public static string Title { - get { - return ResourceManager.GetString("Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Bulk Add Tags.... - /// - public static string TitleBulkAdd { - get { - return ResourceManager.GetString("TitleBulkAdd", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Import.... - /// - public static string TitlemportDialog { - get { - return ResourceManager.GetString("TitlemportDialog", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Recently Added/Edited Tags. - /// - public static string TitleRecents { - get { - return ResourceManager.GetString("TitleRecents", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} - Tag Hierarchy Manager. - /// - public static string TitleWithDatabase { - get { - return ResourceManager.GetString("TitleWithDatabase", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have unsaved changes to the currently loaded tag. Do you want to save them now?. - /// - public static string UnsavedChangesMessage { - get { - return ResourceManager.GetString("UnsavedChangesMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to https://github.com/FlakyBlueJay/TagHierarchyManager. - /// - public static string URL { - get { - return ResourceManager.GetString("URL", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Query to search for.... - /// - public static string WatermarkSearchQuery { - get { - return ResourceManager.GetString("WatermarkSearchQuery", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Aliases/A.K.As (Separated by semi-colons). - /// - public static string WatermarkTagAliases { - get { - return ResourceManager.GetString("WatermarkTagAliases", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag bindings (Separated by semi-colons, e.g. genre; style). - /// - public static string WatermarkTagBindings { - get { - return ResourceManager.GetString("WatermarkTagBindings", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag name (required). - /// - public static string WatermarkTagName { - get { - return ResourceManager.GetString("WatermarkTagName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Notes. - /// - public static string WatermarkTagNotes { - get { - return ResourceManager.GetString("WatermarkTagNotes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tag parents (Separated by semi-colons). - /// - public static string WatermarkTagParents { - get { - return ResourceManager.GetString("WatermarkTagParents", resourceCulture); - } - } - } -} diff --git a/UI/TagHierarchyManager.UI.csproj b/UI/TagHierarchyManager.UI.csproj index 836a0b7..136ed97 100644 --- a/UI/TagHierarchyManager.UI.csproj +++ b/UI/TagHierarchyManager.UI.csproj @@ -11,22 +11,25 @@ - Resources.Designer.cs PublicResXFileCodeGenerator + Resources.Designer.cs + - - True - True - Resources.resx - - UnsavedCancelDialog.axaml Code + + + True + True + Resources.resx + + + diff --git a/UI/Views/RecentsWindow.axaml.cs b/UI/Views/RecentsWindow.axaml.cs index 7a57148..b8dbf49 100644 --- a/UI/Views/RecentsWindow.axaml.cs +++ b/UI/Views/RecentsWindow.axaml.cs @@ -26,7 +26,8 @@ public partial class RecentsWindow : Window public void DataGrid_DoubleTapped(object sender, RoutedEventArgs e) { - if (e.Source is Control control && control.DataContext is RecentsViewModel.TagRow row) + if (this.ViewModel is null) return; + if (e.Source is Control { DataContext: RecentsViewModel.TagRow row }) this.ViewModel.ActivateRowToTagItem(row); } } \ No newline at end of file -- 2.51.2