< Summary

Information
Class: MyNet.UI.Toasting.Settings.ToastManagerOptions
Assembly: MyNet.UI
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Toasting/Settings/ToastManagerOptions.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 55
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.UI/Toasting/Settings/ToastManagerOptions.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="ToastManagerOptions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using MyNet.Primitives;
 9using MyNet.UI.Notifications.Models;
 10
 11namespace MyNet.UI.Toasting.Settings;
 12
 13/// <summary>
 14/// Represents the configuration options for the ToastManager, allowing customization of toast display behavior such as 
 15/// </summary>
 16public class ToastManagerOptions
 17{
 18    /// <summary>
 19    /// Gets or sets the maximum number of toasts that can be displayed simultaneously. If the number of active toasts e
 20    /// </summary>
 21    public int MaxVisibleToasts { get; set; } = 3;
 22
 23    /// <summary>
 24    /// Gets or sets the maximum number of toasts that can be queued. If the queue exceeds this limit, additional toasts
 25    /// </summary>
 26    public int MaxQueueSize { get; set; } = 50;
 27
 28    /// <summary>
 29    /// Gets or sets the function used to determine the priority of a notification. Higher values indicate higher priori
 30    /// </summary>
 31    public Func<INotification, int> PrioritySelector { get; set; } =
 5432        n => n.Severity switch
 5433        {
 5434            NotificationSeverity.Error => 100,
 5435            NotificationSeverity.Warning => 80,
 5436            NotificationSeverity.Success => 50,
 5437            _ => 10
 5438        };
 39
 40    /// <summary>
 41    /// Gets or sets the default duration for which a toast is displayed before it is automatically dismissed. This can 
 42    /// </summary>
 5443    public TimeSpan DefaultDuration { get; set; } = 5.Seconds();
 44
 45    /// <summary>
 46    /// Gets or sets the default closing strategy applied when a toast is created.
 47    /// </summary>
 48    public ToastClosingStrategy DefaultClosingStrategy { get; set; } = ToastClosingStrategy.AutoClose;
 49
 50    /// <summary>
 51    /// Gets or sets a value indicating whether toasts pause auto-close while the pointer is over them.
 52    /// </summary>
 53    public bool DefaultFreezeOnMouseEnter { get; set; } = true;
 54}
 55

Methods/Properties

.ctor()