2
0

Added method to delete Library/Notification-Connector

This commit is contained in:
glax 2023-08-27 01:00:13 +02:00
parent f916cda0f1
commit a94d3d6b40

View File

@ -57,6 +57,11 @@ public abstract class GlobalBase
File.WriteAllText(settings.notificationConnectorsFilePath, JsonConvert.SerializeObject(notificationConnectors)); File.WriteAllText(settings.notificationConnectorsFilePath, JsonConvert.SerializeObject(notificationConnectors));
} }
protected void DeleteNotificationConnector(NotificationConnector.NotificationManagerType notificationManagerType)
{
notificationConnectors.RemoveWhere(nc => nc.notificationManagerType == notificationManagerType);
}
protected void UpdateLibraries() protected void UpdateLibraries()
{ {
foreach(LibraryConnector lc in libraryConnectors) foreach(LibraryConnector lc in libraryConnectors)
@ -73,6 +78,11 @@ public abstract class GlobalBase
File.WriteAllText(settings.libraryConnectorsFilePath, JsonConvert.SerializeObject(libraryConnectors)); File.WriteAllText(settings.libraryConnectorsFilePath, JsonConvert.SerializeObject(libraryConnectors));
} }
protected void DeleteLibraryConnector(LibraryConnector.LibraryType libraryType)
{
libraryConnectors.RemoveWhere(lc => lc.libraryType == libraryType);
}
protected bool IsFileInUse(string filePath) protected bool IsFileInUse(string filePath)
{ {
if (!File.Exists(filePath)) if (!File.Exists(filePath))