Class BackupManager
- Namespace
- RadioExt_Helper.utility
- Assembly
- RadioExt-Helper.dll
public class BackupManager
- Inheritance
-
BackupManager
- Inherited Members
Constructors
BackupManager(CompressionLevel)
public BackupManager(CompressionLevel level)
Parameters
level
CompressionLevel
Properties
BackupCompressionLevel
public CompressionLevel BackupCompressionLevel { get; }
Property Value
Methods
BackupStagingFolderAsync(string, string, bool)
public Task BackupStagingFolderAsync(string stagingPath, string backupPath, bool shouldCopySongFiles)
Parameters
stagingPath
string- The path to the staging folder.
backupPath
string- The path to a backup folder.
shouldCopySongFiles
bool- Indicate whether the actual song files should be included in the backed up file or not.
Returns
Exceptions
- ArgumentNullException
- If either
stagingPath
orbackupPath
arenull
or empty. - ArgumentException
- If the backup path is the same as the staging path.
- ArgumentException
- If the compression level is not between 0 and 9.
CancelBackup()
public void CancelBackup()
CancelRestore()
public void CancelRestore()
GetBackupPreviewAsync(string)
The preview includes a list of FilePreview objects, the total size of the files, and the estimated compressed size.
public Task GetBackupPreviewAsync(string stagingPath)
Parameters
stagingPath
string- The path to preview the backup of.
Returns
- Task
- A task representing the asynchronous operation.
Exceptions
- ArgumentNullException
- Occurs if the
stagingPath
isnull
or empty.
GetRestorePreviewAsync(string)
The preview includes a list of FilePreview objects and the total size of the files.
public Task GetRestorePreviewAsync(string backupFilePath)
Parameters
backupFilePath
string- The path of the backed up .zip to preview.
Returns
- Task
- A task representing the asynchronous operation.
Exceptions
- ArgumentNullException
- Occurs if the
backupFilePath
isnull
or empty.
RestoreBackupAsync(string, string)
public Task RestoreBackupAsync(string backupFilePath, string restorePath)
Parameters
backupFilePath
string- The path to the backup zip file.
restorePath
string- The path to the directory the .zip file should be restored to.
Returns
- Task
- A task representing the restore operation.
Events
BackupCompleted
Event data includes a flag indicating success, the path to the backup folder, and backup file name.
public event Action<bool, string, string>? BackupCompleted
Event Type
BackupPreviewCompleted
Event data is a tuple with the list of previews, the total size of the files, and the estimated compressed size.
public event Action<(List<FilePreview> Previews, long TotalSize, long EstimatedCompressedSize)>? BackupPreviewCompleted
Event Type
PreviewProgressChanged
Event data includes the current progress percentage.
public event Action<int>? PreviewProgressChanged
Event Type
PreviewStatusChanged
Event data is a tuple containing the current FilePreview object and the current estimated backup size, in bytes.
public event Action<(FilePreview, long)>? PreviewStatusChanged
Event Type
- Action<(FilePreview, long)>
ProgressChanged
Event data includes the current progress percentage.
public event Action<int>? ProgressChanged
Event Type
RestoreCompleted
Event data includes a flag indicating success and the restore path.
public event Action<bool, string>? RestoreCompleted
Event Type
RestorePreviewCompleted
Event data is a tuple containing the current FilePreview object and the current estimated restore size, in bytes.
public event Action<(List<FilePreview>, long)>? RestorePreviewCompleted
Event Type
- Action<(List<FilePreview>, long)>
StatusChanged
Event data includes a message describing the current status.
public event Action<string>? StatusChanged