Along with our RTM version of the Visual Studio Visualization and Modeling SDK, we have posted a new sample on the Code Gallery site: DslDesigner extension for Modelbus authoring
Once you have installed the tool, open your DSL solution, open the DslDefinition.dsl, and right click:
The context menu contains a command named “Enable ModelBus”.
Using it you’ll get the following dialog
If you check both check-boxes, this dialog will:
Of course you can chose only one of these options if you want.
Once you have enabled your DSL to consume the Modelbus, you can add Domain properties of type ModelBusReference to your domain classes, and chose the “Edit ModelBusReference specific properties”.
Then, you get a dialog, enabling you to specify options to control the picker UI. for instance, if you want to propose to the user to only pick StateMachine model elements in .sm files, you can do the following.
You DslDefinition.dsl will be modified (incrementally) to add the necessary custom attributes to your reference DomainProperty, and when you rebuild (assuming you enabled T4-Msbuild, or otherwise transform all templates and rebuild), each Component Domain instance of your designer now has new property MyReference that can reference a state machine.
We received in the past many questions, suggestions, requests, for new features, some of them being very specific. We therefore decided to enable the DslDesigner to be extensible and we wanted to show you that you can, if you wish, add yourself great features to the DslDesigner. That’s not that complex to do!
Along with the Release Candidate version of the VsVmSdk, we already proposed a simple extension to the DslDesigner sample from the Code gallery site. Also, in the MSDN library, there is a page describing http://msdn.microsoft.com/en-us/library/ff519533.aspx. Once you’ll have understood the basics of it, you’ll be able to look at the code for this new modelbus authoring tool, and understand how to integrate your features.
In my next posts, I’ll describe the architecture of this sample to help you dig into it, since it involves information about DslDesigner extensions, modelbus authoring, and visual studio integration (we add projects, files, modify other files). Also, you might have noticed that we are using here the fact that we enabled the DslDesigner to discover its MEF extensions (containing commands, validation, double-click and drag&drop gestures). The good new is that you can also, if you wish, enable your own designers to discover their extensions by MEF, and I’ll explain how to do this.
Meanwhile, we would appreciate very much your feedback. Do you find it useful to be able to extend the DSL Tools authoring tool? Do you have ideas of what you would like to add? Do you find it useful you enable your own designer to be extensible in a simple way using MEF?