From 69135944be6a381a372de49ba01ff8b1d8584a96 Mon Sep 17 00:00:00 2001 From: Generoso Martello Date: Wed, 26 Dec 2018 01:50:48 +0100 Subject: [PATCH] Fix #321 (modules delete); Updated MIG and related packages --- HomeGenie/HomeGenie.csproj | 8 ++++---- HomeGenie/Service/Handlers/Config.cs | 9 +++------ HomeGenie/Service/Utility.cs | 8 ++++---- HomeGenie/packages.config | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/HomeGenie/HomeGenie.csproj b/HomeGenie/HomeGenie.csproj index 1cb529b9a..9092e7367 100644 --- a/HomeGenie/HomeGenie.csproj +++ b/HomeGenie/HomeGenie.csproj @@ -70,7 +70,7 @@ - packages\CM19Lib.1.1.2\lib\CM19Lib.dll + packages\CM19Lib.1.1.3\lib\CM19Lib.dll True @@ -123,11 +123,11 @@ True - packages\MIG.1.0.8\lib\MIG.dll + packages\MIG.1.0.9\lib\MIG.dll True - - packages\MIG.HomeAutomation.1.0.9\lib\MIG.HomeAutomation.dll + + packages\MIG.HomeAutomation.1.0.10\lib\MIG.HomeAutomation.dll True diff --git a/HomeGenie/Service/Handlers/Config.cs b/HomeGenie/Service/Handlers/Config.cs index 0b15b9cd9..a38089b6c 100644 --- a/HomeGenie/Service/Handlers/Config.cs +++ b/HomeGenie/Service/Handlers/Config.cs @@ -755,17 +755,14 @@ public void ProcessRequest(MigClientRequest request) break; case "Modules.Delete": - var deletedModule = homegenie.Modules.Find(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1)); - if (deletedModule != null) - { - homegenie.Modules.Remove(deletedModule); - } + homegenie.Modules.RemoveAll(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1)); + homegenie.VirtualModules.RemoveAll(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1)); request.ResponseData = new ResponseText("OK"); // homegenie.UpdateModulesDatabase(); break; - case "Stores.List": + case "Stores.List": { var module = homegenie.Modules.Find(m => m.Domain == migCommand.GetOption(0) && m.Address == migCommand.GetOption(1)); if (module != null) diff --git a/HomeGenie/Service/Utility.cs b/HomeGenie/Service/Utility.cs index 3325d42c2..352767e07 100644 --- a/HomeGenie/Service/Utility.cs +++ b/HomeGenie/Service/Utility.cs @@ -101,16 +101,16 @@ public object LockObject base.Add(value); } - public new void RemoveAll(Predicate predicate) + public new int RemoveAll(Predicate predicate) { lock (syncLock) - base.RemoveAll(predicate); + return base.RemoveAll(predicate); } - public new void Remove(T item) + public new bool Remove(T item) { lock (syncLock) - base.Remove(item); + return base.Remove(item); } public new void Sort(Comparison comparison) diff --git a/HomeGenie/packages.config b/HomeGenie/packages.config index 8e1d08bba..18e01acdd 100644 --- a/HomeGenie/packages.config +++ b/HomeGenie/packages.config @@ -1,14 +1,14 @@  - + - - + +