From d7e00ed22f87e02c2c958d799c375ccbf6d65d58 Mon Sep 17 00:00:00 2001 From: Mike Williams-UK Date: Wed, 7 Feb 2024 08:41:38 +0000 Subject: [PATCH] Merged PR 663: Restore lost delete button from library Related work items: #1124 --- src/Chem4Word.V3/Data/Chem4Word-Versions.xml | 4 +-- src/Chem4Word.V3/Data/This-Version.xml | 2 +- src/Chem4Word.V3/Library/LibraryController.cs | 10 +++--- .../Library/LibraryViewControl.xaml | 10 ++---- .../Library/LibraryViewControl.xaml.cs | 18 ++++++++++ src/Chem4Word.V3/Properties/AssemblyInfo.cs | 4 +-- .../Controls/ChemistryItem.xaml | 33 ++++++++++++++----- .../Chem4Word.ACME/Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Chem4Word.Core/Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Chem4WordSetup/Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- src/Installer/WiXInstaller/Product.wxs | 2 +- src/Notes/Releases.txt | 2 +- .../Contracts/Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../OoXmlV4/Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Properties/AssemblyInfo.cs | 4 +-- .../Wpf.UI.Sandbox/Properties/AssemblyInfo.cs | 4 +-- src/UnitTests/Properties/AssemblyInfo.cs | 4 +-- 30 files changed, 98 insertions(+), 71 deletions(-) diff --git a/src/Chem4Word.V3/Data/Chem4Word-Versions.xml b/src/Chem4Word.V3/Data/Chem4Word-Versions.xml index e0c3ae89..bdaff209 100644 --- a/src/Chem4Word.V3/Data/Chem4Word-Versions.xml +++ b/src/Chem4Word.V3/Data/Chem4Word-Versions.xml @@ -5,10 +5,10 @@ 3.2.17 Release 12 false - 31-Jan-2024 + 07-Feb-2024 ... - ... + BugFix: Restore missing delete button from library Please note any previous beta versions V3.2.4 and below will cease to allow insertion or editing of chemistry If you like our product, please consider buying us a coffee at https://www.buymeacoffee.com/chem4word Please download Chem4Word-Setup.exe via https://www.chem4word.co.uk/download/ if you encounter any difficulties updating diff --git a/src/Chem4Word.V3/Data/This-Version.xml b/src/Chem4Word.V3/Data/This-Version.xml index 7b7970e9..78a1ebe0 100644 --- a/src/Chem4Word.V3/Data/This-Version.xml +++ b/src/Chem4Word.V3/Data/This-Version.xml @@ -2,5 +2,5 @@ 3.2.17 Release 12 false - 31-Jan-2024 + 07-Feb-2024 \ No newline at end of file diff --git a/src/Chem4Word.V3/Library/LibraryController.cs b/src/Chem4Word.V3/Library/LibraryController.cs index 56723dfc..d47a76aa 100644 --- a/src/Chem4Word.V3/Library/LibraryController.cs +++ b/src/Chem4Word.V3/Library/LibraryController.cs @@ -38,13 +38,13 @@ public LibraryController(TelemetryWriter telemetry, LibraryOptions libraryOption _telemetry = telemetry; _libraryOptions = libraryOptions; - ChemistryItems = new ObservableCollection(); + ChemistryItems = new ObservableCollection(); ChemistryItems.CollectionChanged += ChemistryItems_CollectionChanged; LoadChemistryItems(); } - private void LoadChemistryItems() + public void LoadChemistryItems() { string module = $"{_product}.{_class}.{MethodBase.GetCurrentMethod().Name}()"; try @@ -57,7 +57,7 @@ private void LoadChemistryItems() foreach (var chemistryDto in dto) { - var obj = new ACME.Models.ChemistryObject + var obj = new ChemistryObject { Id = chemistryDto.Id, Cml = chemistryDto.Cml, @@ -118,7 +118,7 @@ private void DeleteChemistry(IList eOldItems) if (!_initializing) { var lib = new Libraries.Database.Library(_telemetry, _libraryOptions); - foreach (ACME.Models.ChemistryObject chemistry in eOldItems) + foreach (ChemistryObject chemistry in eOldItems) { lib.DeleteChemistry(chemistry.Id); } @@ -141,7 +141,7 @@ private void AddNewChemistry(IList eNewItems) if (!_initializing) { var lib = new Libraries.Database.Library(_telemetry, _libraryOptions); - foreach (ACME.Models.ChemistryObject chemistry in eNewItems) + foreach (ChemistryObject chemistry in eNewItems) { var cmlConverter = new CMLConverter(); chemistry.Id = lib.AddChemistry(cmlConverter.Import(chemistry.Cml), chemistry.Name, chemistry.Formula); diff --git a/src/Chem4Word.V3/Library/LibraryViewControl.xaml b/src/Chem4Word.V3/Library/LibraryViewControl.xaml index 13dd9d6c..b91f4cbf 100644 --- a/src/Chem4Word.V3/Library/LibraryViewControl.xaml +++ b/src/Chem4Word.V3/Library/LibraryViewControl.xaml @@ -59,17 +59,11 @@ - - - - Library.db - - - + - - - - - + Width="32" + Height="32" + Click="OnItemButtonClick" + HorizontalAlignment="Left" + Style="{StaticResource NavButtonStyle}" + Tag="Library|DeleteStructure"> + Delete the chemistry from your library + + + + + +