Skip to main content

CommandContext

A class in Root.Township, Alta.Console.

Who ran a console command and with what: the calling user, their group permissions, the raw text and a selection. Passed to requirement checks.

Constructors​

MemberWhat it is
CommandContext(UserInfoWithPermissions user)Creates a CommandContext from user and groupPermissions.
CommandContext(UserInfoWithPermissions user, IEnumerable<GroupPermissions> groupPermissions)Creates a CommandContext from user and groupPermissions.

Properties​

MemberWhat it is
UserInfoWithPermissions CallingUser { get; }The user who ran the command, with their permissions.
DateTime CreationTime { get; }When the context was made.
IEnumerable<GroupPermissions> GroupPermissions { get; }The caller's group permissions; empty if none were given.
string RawCommand { get; set; }The command text as typed.
AltaSelection Selection { get; }Selection state commands can read or change.

Used in​

Members of other types that take, return or hold a CommandContext: