Add Git overlay, operation tools, and virtualized preview so large folders stay responsive.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -62,6 +62,45 @@ public sealed class FileOperationService
|
||||
return dest;
|
||||
}
|
||||
|
||||
public Task EnqueueRenameAsync(string path, string newName, CancellationToken cancellationToken = default)
|
||||
=> _queue.EnqueueRenameAsync(path, newName, cancellationToken);
|
||||
|
||||
public async Task EnqueueRenameAsync(IReadOnlyList<(string Path, string NewName)> items, CancellationToken cancellationToken = default)
|
||||
{
|
||||
foreach (var (path, newName) in items)
|
||||
{
|
||||
await _queue.EnqueueRenameAsync(path, newName, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
public Task EmptyRecycleBinAsync(CancellationToken cancellationToken = default)
|
||||
=> _queue.EnqueueEmptyRecycleBinAsync(cancellationToken);
|
||||
|
||||
public Task ExtractAsync(string archivePath, string destinationDirectory, CancellationToken cancellationToken = default)
|
||||
=> _queue.EnqueueExtractAsync(archivePath, destinationDirectory, cancellationToken);
|
||||
|
||||
public Task CompressAsync(IReadOnlyList<string> sources, string archivePath, CancellationToken cancellationToken = default)
|
||||
=> _queue.EnqueueCompressAsync(sources, archivePath, cancellationToken);
|
||||
|
||||
public Task AddToArchiveAsync(string archivePath, IReadOnlyList<string> sources, CancellationToken cancellationToken = default)
|
||||
=> _queue.EnqueueAddToArchiveAsync(archivePath, sources, cancellationToken);
|
||||
|
||||
public Task VerifyArchiveAsync(string archivePath, CancellationToken cancellationToken = default)
|
||||
=> _queue.EnqueueVerifyArchiveAsync(archivePath, cancellationToken);
|
||||
|
||||
public static string UniqueArchivePath(string directory, string stem, string extension)
|
||||
{
|
||||
extension = extension.Trim().TrimStart('.');
|
||||
var dest = Path.Combine(directory, stem + "." + extension);
|
||||
var i = 2;
|
||||
while (File.Exists(PathRules.ToExtended(dest)) || Directory.Exists(PathRules.ToExtended(dest)))
|
||||
{
|
||||
dest = Path.Combine(directory, $"{stem} ({i++}).{extension}");
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
public void Rename(string path, string newName)
|
||||
{
|
||||
var parent = PathRules.Parent(path);
|
||||
|
||||
Reference in New Issue
Block a user