mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-21 01:59:49 +00:00
ab1b604aec
* Resolve warnings and move shared props to Directory.Build.props and Directory.Packages.props * Cleanup more messages * Fix more messages * Fix build issues
19 lines
527 B
C#
19 lines
527 B
C#
using Microsoft.Extensions.Options;
|
|
|
|
namespace Daybreak.Shared.Models;
|
|
public sealed class StaticOptionsMonitor<T>(T currentValue)
|
|
: IOptionsMonitor<T>
|
|
{
|
|
public T CurrentValue { get; } = currentValue;
|
|
|
|
public T Get(string? name) => this.CurrentValue;
|
|
|
|
public IDisposable? OnChange(Action<T, string?> listener) => EmptyDisposable.Instance;
|
|
|
|
private sealed class EmptyDisposable : IDisposable
|
|
{
|
|
public static readonly EmptyDisposable Instance = new();
|
|
public void Dispose() { }
|
|
}
|
|
}
|