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
29 lines
598 B
C#
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();
|
|
}
|
|
}
|