diff --git a/CommandHook/CommandRegistration.cs b/CommandHook/CommandRegistration.cs index 610281d..e704474 100644 --- a/CommandHook/CommandRegistration.cs +++ b/CommandHook/CommandRegistration.cs @@ -1,10 +1,26 @@ namespace CommandHook; +/// +/// The pair of callbacks a listener provides for a command. Either one can be null. +/// public struct CommandRegistration { + /// + /// Called before the command runs. Set on + /// via the ref parameter inside your delegate to stop + /// the command from executing and skip any remaining Before listeners. + /// public readonly CommandBeforeDelegate? Before; + + /// + /// Called after the command runs, with its result. Not called if a Before + /// listener cancelled the command. + /// public readonly CommandAfterDelegate? After; + /// + /// Creates a registration. Pass null for either delegate to only hook one side. + /// public CommandRegistration(CommandBeforeDelegate? before, CommandAfterDelegate? after) { Before = before;