DeadByDaylightBackup.Business/Program/BackupHandler.cs
/// <summary>
/// Delete the backup with a specified id
/// </summary>
/// <param name="id">id to delete</param>
Delete the backup with a specified id
Delete the backup with a specified id
public void DeleteBackup(long id)
        {
            try
            {
                lock (BackupStore)
                {
                    if (BackupStore.ContainsKey(id))
                    {
                        var backup = BackupStore[id];
                        while (BackupStore.ContainsKey(id))
                        {
                            BackupStore.Remove(id);
                        }
                        _triggerLauncher.TriggerDeletionEvent(backup);
                        FileUtility.DeleteFile(backup.FullFileName);
                    }
                    else
                    {
                        throw new KeyNotFoundException("Unkown Backup id");
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.Log(LogLevel.Error, ex, "Failed to remove backup '{0}' Because of {1}", id, ex.Message);
                throw;
            }
        }
public void DeleteBackup ( long id ) { try { lock ( BackupStore ) { if ( BackupStore . ContainsKey ( id ) ) { var backup = BackupStore [ id ] ; while ( BackupStore . ContainsKey ( id ) ) { BackupStore . Remove ( id ) ; } _triggerLauncher . TriggerDeletionEvent ( backup ) ; FileUtility . DeleteFile ( backup . FullFileName ) ; } else { throw new KeyNotFoundException ( " " ) ; } } } catch ( Exception ex ) { _logger . Log ( LogLevel . Error , ex , " " , id , ex . Message ) ; throw ; } }
Delete the backup with a specified id
Delete the backup with a specified id
//  _settingManager.SaveSettings(BackupStore.Values.ToArray());
id
long
id to delete
id to delete