Table of Contents

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

Text string
Expiry DateTime

Properties

Empty

Empty message (already expired).

public static TimedMessage Empty { get; }

Property Value

TimedMessage

Expiry

public DateTime Expiry { readonly get; set; }

Property Value

DateTime

IsVisible

Check if the message is still visible (not expired).

public readonly bool IsVisible { get; }

Property Value

bool

Text

public string Text { readonly get; set; }

Property Value

string

Methods

GetOrDefault(string)

Get the message text if not expired, otherwise return the default.

public readonly string GetOrDefault(string defaultText)

Parameters

defaultText string

Returns

string

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

text string
seconds double

Returns

TimedMessage

Show(string, TimeSpan)

Create a message that expires after the specified duration.

public static TimedMessage Show(string text, TimeSpan duration)

Parameters

text string
duration TimeSpan

Returns

TimedMessage