diff --git a/Utils/FileMutex.cs b/Utils/FileMutex.cs index 2479adc..1b5b051 100644 --- a/Utils/FileMutex.cs +++ b/Utils/FileMutex.cs @@ -47,7 +47,10 @@ namespace BlubbFish.Utils public Boolean Delete() { - this.file.Close(); + if(this.file != null) { + this.file.Close(); + } + File.Delete(this.filename); return !File.Exists(this.filename); } diff --git a/Utils/OwnObject.cs b/Utils/OwnObject.cs index 5eea2aa..3030043 100644 --- a/Utils/OwnObject.cs +++ b/Utils/OwnObject.cs @@ -10,8 +10,7 @@ namespace BlubbFish.Utils private List> loglist = new List>(); public delegate void LogEvent(String location, String message, LogLevel level, DateTime date); - public enum LogLevel : int - { + public enum LogLevel : Int32 { Debug = 1, Notice = 2, Info = 4, @@ -70,9 +69,7 @@ namespace BlubbFish.Utils if (EventError != null && level >= LogLevel.Error) { EventError(location, message, level, date); } - if (EventLog != null) { - EventLog(location, message, level, date); - } + EventLog?.Invoke(location, message, level, date); this.loglist.Add(new Tuple(date, location, message, level)); } }