2020-03-26 19:04:51 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using MediatR;
|
|
|
|
|
using ModernKeePass.Application.Common.Interfaces;
|
|
|
|
|
|
2020-03-30 19:43:04 +02:00
|
|
|
|
namespace ModernKeePass.Application.Parameters.Queries.GetCompressions
|
2020-03-26 19:04:51 +01:00
|
|
|
|
{
|
|
|
|
|
public class GetCompressionsQuery : IRequest<IEnumerable<string>>
|
|
|
|
|
{
|
|
|
|
|
public class GetCompressionsQueryHandler : IRequestHandler<GetCompressionsQuery, IEnumerable<string>>
|
|
|
|
|
{
|
2020-05-14 12:05:05 +02:00
|
|
|
|
private readonly IDatabaseSettingsProxy _databaseSettings;
|
2020-03-26 19:04:51 +01:00
|
|
|
|
|
2020-05-14 12:05:05 +02:00
|
|
|
|
public GetCompressionsQueryHandler(IDatabaseSettingsProxy databaseSettings)
|
2020-03-26 19:04:51 +01:00
|
|
|
|
{
|
2020-05-14 12:05:05 +02:00
|
|
|
|
_databaseSettings = databaseSettings;
|
2020-03-26 19:04:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<string> Handle(GetCompressionsQuery message)
|
|
|
|
|
{
|
2020-05-14 12:05:05 +02:00
|
|
|
|
return _databaseSettings.CompressionAlgorithms.OrderBy(c => c);
|
2020-03-26 19:04:51 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|