I'd like to give user the opportunity to do its own report based on my class hierarchy (object in memory). A scripting language like VBA: Visual Basic for Application. Something that would be evaluated at runtime.
I'd like the user to be able to dynamically create its own report based on some available restricted objects marked with specific attributes only. Give user possibility to create macro where he have similar model as in VBA-Excel : Application/Workbook/WorkSheet/Range/... but with my specific selected objects instead.
Then, he would have been able to use intellisense and add its own functionality to its application.
Update: There is something very important that appears to me. The editor should be preferably part of the application itself in order for the script to know all the environment (namespace, objects, ...) it should interact with. Otherwise, having a scripting engine/editor in a separate process would force the application to be either a "single-instance" app or to create a tricky way to hook the script to a specific running application process.
Does it exists and how to plug it to a .net app?
4 solutions have been proposed:
I also found:
- ScriptCs
- RoslynPad
- Code Project - Anoop Madhusudanan article: C# as a Scripting Language in Your .NET Applications Using Roslyn
But I wonder which one could fits every needs (or most of them):
- Editor with Intellisense
- User have access the currently running process object model (Application as global and all its related objects accessed through application properties). Optional but very nice to have: not necessarily every public properties, only marked ones with specific attributes.
- Interactive environment enabling step by step, debugging, breakpoints, ...
- Editor/debugger Licensed for free redistribution
- Not required, but preferably use C# language
Actual testing:
- I tried to evaluate #2 but there is no VS project sample with all modules working together (which seems a little bit complex to assemble).
- I currently evaluate #6 which seems to work fine (I corrected a minor bug). It seems to fits most points but #3. But it seems to be the closest to my needs yet. It also uses Roslyn which appears to me a positive aspect because it is the Microsoft compiler which should always be up to date.
I'm still waiting to see any feedback from anybody with either other better solutions or any advise to help me take a better decision.