| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="DeduplicableMessageNotification.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | |
| | | 9 | | namespace MyNet.UI.Notifications.Models; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Represents a message notification that can be deduplicated based on its content and severity. |
| | | 13 | | /// </summary> |
| | | 14 | | /// <param name="message">The message content.</param> |
| | | 15 | | /// <param name="title">The title of the notification.</param> |
| | | 16 | | /// <param name="severity">The severity of the notification.</param> |
| | | 17 | | public sealed class DeduplicableMessageNotification(string message, string title = "", NotificationSeverity severity = N |
| | 9 | 18 | | : MessageNotification(message, title, severity), IDeduplicableNotification |
| | | 19 | | { |
| | | 20 | | /// <inheritdoc/> |
| | | 21 | | public bool IsDuplicateOf(INotification other) => |
| | 3 | 22 | | other is MessageNotification m && |
| | 3 | 23 | | string.Equals(Message, m.Message, StringComparison.OrdinalIgnoreCase) && |
| | 3 | 24 | | Severity == m.Severity; |
| | | 25 | | } |
| | | 26 | | |