Class PluginCommands
- Namespace
- Whim
- Assembly
- Whim.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public class PluginCommands : IPluginCommands
- Inheritance
-
PluginCommands
- Implements
- Derived
- Inherited Members
Constructors
PluginCommands(string)
Creates a new instance of the plugin commands.
public PluginCommands(string pluginName)
Parameters
pluginName
string- The name of the plugin.
Properties
Commands
The commands for this plugin.
public IEnumerable<ICommand> Commands { get; }
Property Value
Keybinds
The keybinds for this plugin.
public IEnumerable<(string commandId, IKeybind keybind)> Keybinds { get; }
Property Value
PluginName
The name of the plugin.
public string PluginName { get; init; }
Property Value
Methods
Add(string, string, Action, Func<bool>?, IKeybind?)
Add a command to the plugin.
public PluginCommands Add(string identifier, string title, Action callback, Func<bool>? condition = null, IKeybind? keybind = null)
Parameters
identifier
string- The identifier of the command. This shouldn't include the PluginName.
title
string- The title of the command.
callback
Action- The callback to execute. This can include triggering a menu to be shown by Whim.CommandPalette, or to perform some other action.
condition
Func<bool>- A condition to determine if the command should be visible, or able to be executed. If this is null, the command will always be accessible.
keybind
IKeybind- The keybind to associate with the command.