How to create a new CodeRush (DXCore) plug-in
Note, this article has been moved to the official DevExpress Support Center site. Please refer to the moved article as it might have further updates or additional comments. Thank you.
There are two ways to create a new CodeRush (DXCore) plug-in in Visual Studio:
1. Inside the IDE, from the DevExpress menu, access the “New Plug-in…” menu item:
2. Create a new project of type DXCore (using File –> New Project menu item):
In the next dialog, choose your preferred language (Visual C# or Visual Basic) and select the DXCore category to see available project templates for CodeRush plug-ins:
It is recommended to choose the “New Plug-in…” menu item, because in this case you can tweak additional settings for your new plug-in. The following dialog appears once you click it:
Choose your language of preference as well as the plug-in type, type in the plug-in name and its location if required. Click OK – the DXCore Plug-in Project Settings dialog will appear:
Here you can select a different title and change advanced plug-in settings, or just click OK to accept the default settings.
- System Plug-In – сheck it if you’d like your plug-in to be loaded before all other plug-ins do. Simple plug-in doesn’t need this option in most of the time. System plug-ins are built to the “IDETools\System\DXCore\Bin\System\” folder and usual plug-in will be built to the “IDETools\System\DXCore\Bin\PlugIns\” folder.
- Load Manually – check it if you want to not load the plug-in automatically when DXCore loads in Visual Studio, this option is only relevant to the development phase. For example, suppose that whilst developing your plugin, you are suddenly required to do something else. But because DXCore loads your plug-in into memory on its startup automatically, the plugin’s assembly is locked, so, you won’t be able to recompile your plug-in whilst your Visual Studio is not closed. In order to avoid this scenario, change the “Load Manually” option to ensure that the DXCore never automatically loads your plugin. After that, you’re able to load plugin using the PlugIn Manager (DevExpress -> Options -> Core -> PlugIn Manager). With the PlugIn Manager you have only load your plugin into the address space of a single instance of Visual Studio. This means that when you shut down this single copy of Visual Studio, you’ll be able to continue development of your plugin.
- Default Load Type – different types of loading your plug-in:
- On Demand – plug-in is loaded when some process or action, for which the plugin should work, takes place, e.g. if your plugin listens to one of the events – then it will be loaded only when this event is being fired. Or, another example, if your plug-in contains an options page, the plugin will be loaded when the Options Dialog is going to display this page.
- On Idle – plug-in will be loaded when Visual Studio editor is being idle (no user operations/interaction with IDE).
- At Start-up – plugin will be loaded on DXCore start-up, which will add time to overall loading time.
The best option here is the default one – “On Demand”. Most of the built-in DXCore plug-ins use this load type option.
Click OK to accept your settings; the plug-in designer surface will be opened in Visual Studio:
The new plug-in does not provide any functionality yet. You can drop any DXCore component on its surface and subscribe to required events including those coming from Visual Studio to extend the Visual Studio IDE.—– Products: DXCore Versions: all VS IDEs: any Updated: Jul/30/2012 ID: D005