Skip to content

CommandArgs

class cAlgo.API

DesktopCLICloud

Represents a plugin command callback arguments.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

public class CommandArgs

Namespace: cAlgo.API · Group: Commands

Examples

protected override void OnStart()
{
    Commands.Add(CommandType.ChartContainerToolbar, OnCommandExecuted);
}

private void OnCommandExecuted(CommandArgs args)
{
    Print("Command {0} executed, context: {1}", args.Command.Id, args.Context);
}
from System import Action

def on_start(self):
    api.Commands.Add(CommandType.ChartContainerToolbar, Action[CommandArgs](self.on_command_executed))

def on_command_executed(self, args):
    api.Print(f"Command {args.Command.Id} executed, context: {args.Context}")

Properties

Name Description
CommandDesktopCLICloudCommand Gets the command associated with these arguments.
ContextDesktopCLICloudobject Gets the context in which the command is executed.

See also