microsoft / microsoft/microsoft-performance-toolkit-sdk

Add support for specifying if a table command can be executed

Open
#199 0 comments 1 reaction 1 assignee View on GitHub

@mslukebo is already working on this.

Since Apr 14, 2022.

enhancement untriaged
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.