Files
Daybreak/Daybreak.Shared/Models/Notifications/NotificationCancellationToken.cs
amacocian ab1b604aec Code cleanup (#1026)
* Resolve warnings and move shared props to Directory.Build.props and Directory.Packages.props

* Cleanup more messages

* Fix more messages

* Fix build issues
2025-06-29 17:32:52 +02:00

29 lines
598 B
C#

using System.Core.Extensions;
using System.Extensions;
namespace Daybreak.Shared.Models.Notifications;
public readonly struct NotificationToken : IDisposable
{
private readonly Notification notification;
public readonly DateTime? ExpirationTime;
public bool Closed => this.notification.Closed;
internal NotificationToken(Notification notification)
{
this.notification = notification.ThrowIfNull();
}
public void Cancel()
{
this.notification.CancellationRequested = true;
}
public void Dispose()
{
this.Cancel();
}
}