Struct TimedMessage
- Namespace
- MiniTui
- Assembly
- MiniTui.dll
A timed message that expires after a duration.
public record struct TimedMessage : IEquatable<TimedMessage>
- Implements
- Inherited Members
Constructors
TimedMessage(string, DateTime)
A timed message that expires after a duration.
public TimedMessage(string Text, DateTime Expiry)
Parameters
Properties
Empty
Empty message (already expired).
public static TimedMessage Empty { get; }
Property Value
Expiry
public DateTime Expiry { readonly get; set; }
Property Value
IsVisible
Check if the message is still visible (not expired).
public readonly bool IsVisible { get; }
Property Value
Text
public string Text { readonly get; set; }
Property Value
Methods
GetOrDefault(string)
Get the message text if not expired, otherwise return the default.
public readonly string GetOrDefault(string defaultText)
Parameters
defaultTextstring
Returns
Show(string, double)
Create a message that expires after the specified seconds.
[SuppressMessage("ApiDesign", "RS0027:API with optional parameter(s) should have the most parameters amongst its public overloads", Justification = "The overloads differ by parameter type, so calls are never ambiguous; kept from 0.7 for source compatibility.")]
public static TimedMessage Show(string text, double seconds = 3)
Parameters
Returns
Show(string, TimeSpan)
Create a message that expires after the specified duration.
public static TimedMessage Show(string text, TimeSpan duration)