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
messageIdChatMessageIdThe message the action belongs to.
actionChatMessageActionThe action being dispatched.
setStatusAction<string, NotificationSeverity>Delegate that sets the message's status row.
hideActionsActionDelegate that removes the message's actions row.
setPressedAction<bool>Delegate that sets a toggle action's pressed state.
Properties
Action
The action being dispatched.
public ChatMessageAction Action { get; }
Property Value
MessageId
The message this action belongs to.
public ChatMessageId MessageId { get; }
Property Value
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
pressedboolThe new pressed state.
SetStatus(string, NotificationSeverity?)
Sets this message's status row.
public void SetStatus(string text, NotificationSeverity? severity = null)
Parameters
textstringThe status text.
severityNotificationSeverityOptional severity that tints the status text.