Add foundation

This commit is contained in:
TheXamlGuy
2024-04-13 11:29:32 +01:00
parent 6f31aa8513
commit 053d8a851e
264 changed files with 3428 additions and 4683 deletions
@@ -0,0 +1,21 @@
namespace Toolkit.Foundation;
public class ConfigurationChangedHandler<TConfiguration, TValue>(ConfigurationValue<TConfiguration, TValue> configurationValue) :
INotificationHandler<Changed<TConfiguration>>
where TValue :
class, new()
{
public Task Handle(Changed<TConfiguration> args,
CancellationToken cancellationToken = default)
{
if (args.Value is TConfiguration configuration)
{
if (configurationValue.TryUpdate(configuration, out TValue value))
{
}
}
return Task.CompletedTask;
}
}