Skip to content

Add support for column commands and download source code. - #445

Open
Jayson Maxson (jmaxson-ms) wants to merge 24 commits into
mainfrom
user/jmaxson/columnCommands
Open

Jayson Maxson (jmaxson-ms) wants to merge 24 commits into
mainfrom
user/jmaxson/columnCommands

Conversation

@jmaxson-ms

Copy link
Copy Markdown
Contributor

What's new

New namespace: Microsoft.Performance.SDK.ColumnCommands

  • DataColumnCommands — sealed container that carries the optional commands available on a column. Exposes:
  • DataColumnCommands.Empty
  • TryGetDownloadSourceCodeCommand(out DownloadSourceCodeCommand)
  • DownloadSourceCodeCommand — abstract base a plugin implements to advertise "download source code" for a column value:
  • string CommandName
  • bool CanExecute(object value, string downloadPath)
  • Task ExecuteAsync(object value, string downloadPath, CancellationToken)
  • DownloadSourceCodeResult — result type with a success Uri (typically a local file URI the host opens) or a failure with ErrorMessage and optional attempted Uri.
    New interface: IDataColumnCommands
  • Implemented by DataColumn and HierarchicalDataColumn so hosts can retrieve the DataColumnCommands associated with any column.

Column builder integration

  • ColumnBuilder.WithCommands(DataColumnCommands) — attach commands to the built column, mirroring the existing WithVariants(...) pattern.
  • New WithToggle(..., DataColumnCommands) and WithHierarchicalToggle(..., DataColumnCommands) overloads on ToggleableColumnBuilder, plus equivalent overloads on ModalColumnBuilder and HierarchicalColumnBuilder, so commands can also be scoped to a specific variant.
  • DataColumn / HierarchicalDataColumn constructors accept an optional DataColumnCommands, and the runtime builders (EmptyColumnBuilder, ToggledColumnBuilder, ModalColumnWithModesBuilder) flow it through when materializing columns.

Design notes

  • DataColumnCommands is non-generic. The commands operate on object value because for hierarchical columns the row value may differ from T due to an ICollectionAccessProvider<T, TOut>. This is documented on the type.
  • DownloadSourceCodeCommand itself is non-generic for the same reason and to keep the host-side dispatch simple.
  • Commands were placed on the column (via IDataColumn / IHierarchicalDataColumn) rather than on ITableBuilder, because they are intrinsic column data (like ColumnConfiguration or the projection). The tradeoffs are captured inline in DataColumnCommands.cs.

Comment thread src/Microsoft.Performance.SDK/Processing/ColumnBuilding/ColumnBuilder`1.cs Outdated
Comment thread src/Microsoft.Performance.SDK/Processing/ColumnBuilding/ColumnBuilder`1.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants