Minor improvements

This commit is contained in:
2023-08-17 22:14:10 +02:00
parent b1c2454ed9
commit fd9a20e888
17 changed files with 99 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ public class CompressCommand : CommandBase, IExecutableCommand, ITransportationC
private readonly IUserCommunicationService _userCommunicationService;
private readonly ITimelessContentProvider _timelessContentProvider;
private readonly IContentAccessorFactory _contentAccessorFactory;
private readonly ICommandSchedulerNotifier _commandSchedulerNotifier;
private readonly OptionsInputElement<CompressionType> _compressionType;
private readonly CancellationTokenSource _cancellationTokenSource = new();
private readonly TextInputElement _targetFileName;
@@ -29,6 +30,7 @@ public class CompressCommand : CommandBase, IExecutableCommand, ITransportationC
IUserCommunicationService userCommunicationService,
ITimelessContentProvider timelessContentProvider,
IContentAccessorFactory contentAccessorFactory,
ICommandSchedulerNotifier commandSchedulerNotifier,
IReadOnlyCollection<FullName> sources,
TransportMode mode,
FullName targetFullName)
@@ -36,6 +38,7 @@ public class CompressCommand : CommandBase, IExecutableCommand, ITransportationC
_userCommunicationService = userCommunicationService;
_timelessContentProvider = timelessContentProvider;
_contentAccessorFactory = contentAccessorFactory;
_commandSchedulerNotifier = commandSchedulerNotifier;
ArgumentNullException.ThrowIfNull(sources);
ArgumentNullException.ThrowIfNull(mode);
ArgumentNullException.ThrowIfNull(targetFullName);
@@ -49,7 +52,10 @@ public class CompressCommand : CommandBase, IExecutableCommand, ITransportationC
"CompressionMethod",
Enum.GetValues<CompressionType>()
.Select(t => new OptionElement<CompressionType>(t.ToString(), t))
);
)
{
Value = CompressionType.Zip
};
_inputs = new List<IInputElement>
{
@@ -121,6 +127,8 @@ public class CompressCommand : CommandBase, IExecutableCommand, ITransportationC
disposable.Dispose();
}
}
await _commandSchedulerNotifier.RefreshContainer(Target);
}
private async Task<IEnumerable<IDisposable>> TraverseTree(

View File

@@ -11,15 +11,18 @@ public class CompressCommandFactory : ITransportationCommandFactory<CompressComm
private readonly IUserCommunicationService _userCommunicationService;
private readonly ITimelessContentProvider _timelessContentProvider;
private readonly IContentAccessorFactory _contentAccessorFactory;
private readonly ICommandSchedulerNotifier _commandSchedulerNotifier;
public CompressCommandFactory(
IUserCommunicationService userCommunicationService,
ITimelessContentProvider timelessContentProvider,
IContentAccessorFactory contentAccessorFactory)
IContentAccessorFactory contentAccessorFactory,
ICommandSchedulerNotifier commandSchedulerNotifier)
{
_userCommunicationService = userCommunicationService;
_timelessContentProvider = timelessContentProvider;
_contentAccessorFactory = contentAccessorFactory;
_commandSchedulerNotifier = commandSchedulerNotifier;
}
public CompressCommand GenerateCommand(IReadOnlyCollection<FullName> sources, TransportMode mode, FullName targetFullName)
@@ -27,6 +30,7 @@ public class CompressCommandFactory : ITransportationCommandFactory<CompressComm
_userCommunicationService,
_timelessContentProvider,
_contentAccessorFactory,
_commandSchedulerNotifier,
sources,
mode,
targetFullName

View File

@@ -11,5 +11,5 @@ public class CompressUserCommand : IIdentifiableUserCommand
}
public string UserCommandID => CommandName;
public string Title => "Compress";
public string Title => "Select for compression";
}