microsoft / microsoft/microsoft-performance-toolkit-sdk
Add support for specifying if a table command can be executed
@mslukebo is already working on this.
Since Apr 14, 2022.
- Dominant language
- C#
- Stars
- 239
- Forks
- 78
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 2
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.