Table of Contents

Class ChatActionContext

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Passed to a message action's click handler. Lets the handler drive the message's footer without capturing the control.

public sealed class ChatActionContext
Inheritance
ChatActionContext
Inherited Members
Extension Methods

Constructors

ChatActionContext(ChatMessageId, ChatMessageAction, Action<string, NotificationSeverity?>, Action, Action<bool>)

Initialises a new ChatActionContext.

public ChatActionContext(ChatMessageId messageId, ChatMessageAction action, Action<string, NotificationSeverity?> setStatus, Action hideActions, Action<bool> setPressed)

Parameters

messageId ChatMessageId

The message the action belongs to.

action ChatMessageAction

The action being dispatched.

setStatus Action<string, NotificationSeverity>

Delegate that sets the message's status row.

hideActions Action

Delegate that removes the message's actions row.

setPressed Action<bool>

Delegate that sets a toggle action's pressed state.

Properties

Action

The action being dispatched.

public ChatMessageAction Action { get; }

Property Value

ChatMessageAction

MessageId

The message this action belongs to.

public ChatMessageId MessageId { get; }

Property Value

ChatMessageId

Methods

HideActions()

Removes this message's actions row.

public void HideActions()

SetPressed(bool)

For toggle actions: sets the pressed state.

public void SetPressed(bool pressed)

Parameters

pressed bool

The new pressed state.

SetStatus(string, NotificationSeverity?)

Sets this message's status row.

public void SetStatus(string text, NotificationSeverity? severity = null)

Parameters

text string

The status text.

severity NotificationSeverity

Optional severity that tints the status text.