diff --git a/Source/FileManager/PersistentDictionary.cs b/Source/FileManager/PersistentDictionary.cs index 99a2de79..41918e99 100644 --- a/Source/FileManager/PersistentDictionary.cs +++ b/Source/FileManager/PersistentDictionary.cs @@ -131,6 +131,35 @@ namespace FileManager writeFile(propertyName, parsedNewValue); } + public bool RemoveProperty(string propertyName) + { + if (IsReadOnly) + return false; + + var success = false; + try + { + lock (locker) + { + var jObject = readFile(); + + if (!jObject.ContainsKey(propertyName)) + return false; + + jObject.Remove(propertyName); + + var endContents = JsonConvert.SerializeObject(jObject, Formatting.Indented); + + File.WriteAllText(Filepath, endContents); + success = true; + } + Serilog.Log.Logger.Information("Removed property. {@DebugInfo}", propertyName); + } + catch { } + + return success; + } + private void writeFile(string propertyName, JToken newValue) { if (IsReadOnly) diff --git a/Source/LibationAvalonia/Controls/MyRatingCellEditor.axaml b/Source/LibationAvalonia/Controls/MyRatingCellEditor.axaml index c477ba16..ec58d8ab 100644 --- a/Source/LibationAvalonia/Controls/MyRatingCellEditor.axaml +++ b/Source/LibationAvalonia/Controls/MyRatingCellEditor.axaml @@ -8,9 +8,6 @@ - diff --git a/Source/LibationAvalonia/Controls/Settings/Important.axaml b/Source/LibationAvalonia/Controls/Settings/Important.axaml index 528dbb56..e7e4c828 100644 --- a/Source/LibationAvalonia/Controls/Settings/Important.axaml +++ b/Source/LibationAvalonia/Controls/Settings/Important.axaml @@ -2,18 +2,18 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="450" + mc:Ignorable="d" d:DesignWidth="700" d:DesignHeight="600" xmlns:controls="clr-namespace:LibationAvalonia.Controls" xmlns:vm="clr-namespace:LibationAvalonia.ViewModels.Settings" x:DataType="vm:ImportantSettingsVM" x:Class="LibationAvalonia.Controls.Settings.Important"> - + - + - + - + + + + + + + + + + + + - diff --git a/Source/LibationAvalonia/Views/ProductsDisplay.axaml b/Source/LibationAvalonia/Views/ProductsDisplay.axaml index 2df7e0d1..640391e4 100644 --- a/Source/LibationAvalonia/Views/ProductsDisplay.axaml +++ b/Source/LibationAvalonia/Views/ProductsDisplay.axaml @@ -20,9 +20,6 @@ CanUserReorderColumns="True"> - @@ -31,7 +28,6 @@ -