From beabdc513ca1282f0933837f1201f5013cf6e07d Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Tue, 18 Apr 2017 12:27:11 +0000 Subject: [PATCH] Automatic Cronjob Checkin: 20170418-142622 --- FileMutex.cs | 5 ++++- OwnObject.cs | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FileMutex.cs b/FileMutex.cs index 2479adc..1b5b051 100644 --- a/FileMutex.cs +++ b/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/OwnObject.cs b/OwnObject.cs index 5eea2aa..3030043 100644 --- a/OwnObject.cs +++ b/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)); } }