Table of Contents

Method AddCommand

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

AddCommand(Command, Func<CommandContext, bool?>)

Sets the function that will be invoked for a Command. Views should call AddCommand for each command they support.

If AddCommand has already been called for commandf will replace the old one.

protected void AddCommand(Command command, Func<CommandContext, bool?> f)

Parameters

command Command

The command.

f Func<CommandContext, bool?>

The function.

Remarks

This version of AddCommand is for commands that require CommandContext. Use AddCommand(Command, Func<bool?>) in cases where the command does not require a CommandContext.

AddCommand(Command, Func<bool?>)

Sets the function that will be invoked for a Command. Views should call AddCommand for each command they support.

If AddCommand has already been called for commandf will replace the old one.

protected void AddCommand(Command command, Func<bool?> f)

Parameters

command Command

The command.

f Func<bool?>

The function.

Remarks

This version of AddCommand is for commands that do not require a CommandContext. If the command requires context, use AddCommand(Command, Func<CommandContext, bool?>)