mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-21 12:49:43 +03:00
Add UseRecovery convenience method to ImageContext
This commit is contained in:
parent
49f1047463
commit
18dbc20395
@ -42,10 +42,7 @@ namespace NAPS2.Sdk.Tests
|
||||
public void UseRecovery()
|
||||
{
|
||||
var recoveryFolderPath = Path.Combine(FolderPath, "recovery", Path.GetRandomFileName());
|
||||
rsm = new RecoveryStorageManager(recoveryFolderPath);
|
||||
ImageContext.FileStorageManager = rsm;
|
||||
ImageContext.ConfigureBackingStorage<FileStorage>();
|
||||
ImageContext.ImageMetadataFactory = rsm;
|
||||
ImageContext.UseRecovery(recoveryFolderPath);
|
||||
}
|
||||
|
||||
public ScannedImage CreateScannedImage()
|
||||
|
@ -195,6 +195,14 @@ namespace NAPS2.Images.Storage
|
||||
set => fileStorageManager = value ?? throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
public ImageContext UseRecovery(string recoveryFolderPath)
|
||||
{
|
||||
var rsm = new RecoveryStorageManager(recoveryFolderPath);
|
||||
FileStorageManager = rsm;
|
||||
ImageMetadataFactory = rsm;
|
||||
ConfigureBackingStorage<FileStorage>();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public class GdiImageContext : ImageContext
|
||||
|
Loading…
Reference in New Issue
Block a user