microsoft-performance-toolkit-sdk
microsoft-performance-toolkit-sdk copied to clipboard
Add support for specifying if a table command can be executed
Is your feature request an entirely new concept? Yes - I am proposing adding a method for table authors to supply logic for if a table command can be executed.
Is your feature request related to an existing component?
Yes - it is related to the already existing ITableBuilder.AddTableCommand
method.
Is your feature request related to a problem? Please describe. Yes. Currently, table authors cannot provide hints on if a table command can successfully execute. For example, a table command may only make sense if certain rows are passed in.
Describe the solution you'd like
Add a new method to ITableBuilder
:
ITableBuilder AddTableCommand(string commandName, TableCommandCallback callback, Predicate<IReadOnlyList<int>> canExecute);
Calling the regular AddTableCommand(string commandName, TableCommandCallback callback)
would implicitly call AddTableCommand(string commandName, TableCommandCallback callback, (IReadOnlyList<int>> _) => true)
in existing implementations.
(Alternatively, instead of using the Predicate
definition, there can be a new TableCommandCanExecute
delegate to follow the existing pattern).