Table of Contents

Class ConsoleCommandRegistrarExtensions

Namespace
SkyrimForge
Assembly
SkyrimForge.dll

Provides extension members for IConsoleCommandRegistrar.

public static class ConsoleCommandRegistrarExtensions
Inheritance
ConsoleCommandRegistrarExtensions
Inherited Members

Methods

Register(IConsoleCommandRegistrar, string, string?, string, IEnumerable<string>, Action<ObjectReference?, IReadOnlyList<string>>)

Adds a console command.

public static void Register(this IConsoleCommandRegistrar registrar, string name, string? shortName, string help, IEnumerable<string> parameterNames, Action<ObjectReference?, IReadOnlyList<string>> handler)

Parameters

registrar IConsoleCommandRegistrar
name string

The name the console matches, regardless of case.

shortName string

A second name the console matches, or null.

help string

The text the console's help command shows.

parameterNames IEnumerable<string>

One name per argument. The console passes as many arguments as were entered, up to this count.

handler Action<ObjectReference?, IReadOnlyList<string>>

Runs on the game's thread for a command typed in the console, and on the caller's thread for one run through IConsoleCommands. An exception it throws is written to the plugin's log.

Exceptions

ArgumentNullException

name, help, parameterNames, or handler is null.

ArgumentException

name is empty, a name contains white space, or a console or script command already has name or shortName.

InvalidOperationException

No disabled entry remains.