Skip to content

Commands

Summary

Represents the collection of plugin commands.

Signature

1
public abstract interface Commands

Namespace

cAlgo.API

Methods

GetByType

Summary

Returns all commands based on type.

Signature

1
public abstract Command[] GetByType(CommandType type)

Parameters

Name Type Description
type CommandType Command Type

Return Value

Command[]

GetById

Summary

Returns a command by Id.

Signature

1
public abstract Command GetById(Guid id)

Parameters

Name Type Description
id Guid Command Id

Return Value

Command

Add (4)

Add (1 of 4)

Summary

Adds a new command with a callback.

Signature

1
public abstract Command Add(CommandType type, Action<CommandArgs> callback)

Parameters

Name Type Description
type CommandType Command Type
callback Action Command callback action without result.

Return Value

Command

Add (2 of 4)

Summary

Adds a new command with a callback.

Signature

1
public abstract Command Add(CommandType type, Action<CommandArgs> callback, SvgIcon icon)

Parameters

Name Type Description
type CommandType Command Type
callback Action Command callback action without result.
icon SvgIcon Command Icon

Return Value

Command

Add (3 of 4)

Summary

Adds a new command with a callback.

Signature

1
public abstract Command Add(CommandType type, Func<CommandArgs, CommandResult> callback)

Parameters

Name Type Description
type CommandType Command Type
callback Func Command callback that returns command result.

Return Value

Command

Add (4 of 4)

Summary

Adds a new command with a callback and icon.

Signature

1
public abstract Command Add(CommandType type, Func<CommandArgs, CommandResult> callback, SvgIcon icon)

Parameters

Name Type Description
type CommandType Command Type
callback Func Command callback that returns command result.
icon SvgIcon Command Icon

Return Value

Command

Remove

Summary

Removes a command by Id.

Signature

1
public abstract bool Remove(Guid id)

Parameters

Name Type Description
id Guid Command Id

Return Value

bool

Properties

Count

Summary

Returns number of all commands.

Signature

1
public abstract int Count {get;}

Return Value

int