From a94d3d6b400ddb4450f55be94b2673fe09478cea Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 27 Aug 2023 01:00:13 +0200 Subject: [PATCH] Added method to delete Library/Notification-Connector --- Tranga/GlobalBase.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tranga/GlobalBase.cs b/Tranga/GlobalBase.cs index 1208f9a..a37fd5e 100644 --- a/Tranga/GlobalBase.cs +++ b/Tranga/GlobalBase.cs @@ -57,6 +57,11 @@ public abstract class GlobalBase File.WriteAllText(settings.notificationConnectorsFilePath, JsonConvert.SerializeObject(notificationConnectors)); } + protected void DeleteNotificationConnector(NotificationConnector.NotificationManagerType notificationManagerType) + { + notificationConnectors.RemoveWhere(nc => nc.notificationManagerType == notificationManagerType); + } + protected void UpdateLibraries() { foreach(LibraryConnector lc in libraryConnectors) @@ -73,6 +78,11 @@ public abstract class GlobalBase File.WriteAllText(settings.libraryConnectorsFilePath, JsonConvert.SerializeObject(libraryConnectors)); } + protected void DeleteLibraryConnector(LibraryConnector.LibraryType libraryType) + { + libraryConnectors.RemoveWhere(lc => lc.libraryType == libraryType); + } + protected bool IsFileInUse(string filePath) { if (!File.Exists(filePath))