My project (https://github.com/migueldeicaza/gui.cs) has an example app called UI Catalog. The main UI Catalog app uses reflection to enumerate and display all of the examples; they all derive from the class Scenario:


The Scenarios are all in the ./Scenarios dir; each as an individual .cs file. The filename (e.g. Generic.cs DOES NOT need to match the name of the Scenario (the real name is metadata on the Sceanario class).
UI Catalog accepts the name of a Scenario on the command line; if provided it will directly launch that Scenario.
I'd like to enable dotnet example <Scenario>.
I do not want to force each Scenario to have a .csproj file or to be in a distinct dir.
I do not want to have to modify the existing Scenarios.
I do not want to have Scenario writers have to modify anything but their .cs file (e.g. adding each Scenario to .examples is no bueno).
I'm happy to contribute to this project to enhance it to support what I'm trying to do.
What would be your suggestion on the best way to do this?
My initial thought was to enhance .examples such that this will work:
# Sample .examples file for UICatalog Scenarios
./UICatalog --list
dotnet example --list would then build UICatalog/UICatalog.csproj and run it with --list. It would capture stdout to capture the resulting list of examples ("Name", "Description" pairs).
dotnet example <Scenario> would build UICatalog/UICatalog.csproj and run it with <Scenario>.
What do you think?
My project (https://github.com/migueldeicaza/gui.cs) has an example app called UI Catalog. The main UI Catalog app uses reflection to enumerate and display all of the examples; they all derive from the class
Scenario:The Scenarios are all in the
./Scenariosdir; each as an individual.csfile. The filename (e.g.Generic.csDOES NOT need to match the name of the Scenario (the real name is metadata on the Sceanario class).UI Catalogaccepts the name of a Scenario on the command line; if provided it will directly launch that Scenario.I'd like to enable
dotnet example <Scenario>.I do not want to force each Scenario to have a
.csprojfile or to be in a distinct dir.I do not want to have to modify the existing Scenarios.
I do not want to have Scenario writers have to modify anything but their
.csfile (e.g. adding each Scenario to.examplesis no bueno).I'm happy to contribute to this project to enhance it to support what I'm trying to do.
What would be your suggestion on the best way to do this?
My initial thought was to enhance
.examplessuch that this will work:dotnet example --listwould then buildUICatalog/UICatalog.csprojand run it with--list. It would capture stdout to capture the resulting list of examples ("Name", "Description" pairs).dotnet example <Scenario>would buildUICatalog/UICatalog.csprojand run it with<Scenario>.What do you think?