PowerArgs.Cli.RichTextCommandLineReader.RegisterHandler C# (CSharp) Method

RegisterHandler() public method

Lets you register a custom key handler. You are responsible for ensuring that each key is only handled by one handler. This method will throw if you try to add a duplicate key handler.
public RegisterHandler ( IKeyHandler handler ) : void
handler IKeyHandler The handler to register
return void
        public void RegisterHandler(IKeyHandler handler)
        {
            foreach(var key in handler.KeysHandled)
            {
                KeyHandlers.Add(key, handler);
            }
        }