internal static void RefreshLock(double timeframe)
{
using (var context = new DataHandler())
{
var notificationLock = context.Synchronizations.SingleOrDefault(lockItem => lockItem.LockName == NOTIFICATIONLOCKNAME);
if (notificationLock == null)
throw new InvalidOperationException("Could not update the Notification lock, because it doesn't exist. (the lock must be present when RefreshLock is called.)");
notificationLock.LockedUntil = DateTime.Now.AddMinutes(timeframe);
context.SubmitChanges();
}
Debug.WriteLine("#Notification> ** lock refreshed");
}
internal static void ReleaseLock()