mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
24 lines
693 B
C#
24 lines
693 B
C#
![]() |
using MediatR;
|
|||
|
using ModernKeePass.Application.Common.Interfaces;
|
|||
|
|
|||
|
namespace ModernKeePass.Application.Settings.Queries
|
|||
|
{
|
|||
|
public class GetSettingQuery<T> : IRequest<T>
|
|||
|
{
|
|||
|
public string Key { get; set; }
|
|||
|
|
|||
|
public class GetSettingQueryHandler : IRequestHandler<GetSettingQuery<T>, T>
|
|||
|
{
|
|||
|
private readonly ISettingsProxy _settingsProxy;
|
|||
|
|
|||
|
public GetSettingQueryHandler(ISettingsProxy settingsProxy)
|
|||
|
{
|
|||
|
_settingsProxy = settingsProxy;
|
|||
|
}
|
|||
|
public T Handle(GetSettingQuery<T> message)
|
|||
|
{
|
|||
|
return _settingsProxy.GetSetting<T>(message.Key);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|