This is the third and the latest part of a topic about adding an options page into your DXCore plug-in. See the other parts, to learn more:
- Adding and designing an options page
- Implementing the options page settings storing logic
- Using settings from an options page inside a plug-in (this post)
In this post, we are going to read plug-in settings from the decoupled storage and update them when they are changed on the options page.
Read more…
Here’s the second part of the post about adding an options page into your DXCore plug-in. See the other parts, to learn more:
- Adding and designing an options page
- Implementing the options page settings storing logic (this post)
- Using settings from an options page inside a plug-in
Read more…
This topic is about adding a DXCore Options page. It has three parts to make it easier to read and follow:
- Adding and designing an options page (this post)
- Implementing the options page settings storing logic
- Using settings from an options page inside a plug-in
Here’s the first part of the topic, and the steps we need to accomplish, to add an options page to your plug-in, and make it work:
- Run the options page wizard
- Layout controls on the page
- Add runtime behavior code for controls, if necessary
Read more…
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.
The Add Contract code provider adds conditions for validation of the active method parameters. The Extensible architecture of the DXCore allows you to add new contracts to the list of available contracts using the ContractProvider component inside your plug-in.
The sample below is a rough implementation for the suggestions registered in the DevExpress Support Center database:
- S133903 Add Contract – Use IsNullOrWhiteSpace on contracts
- S136474 Add Contract – Allow it to generate code for single parameter
Read more…
Clipboard History is a visual multi-clipboard viewer and manager, which makes copying and pasting of data a little easier. It allows you to extend the facility of Windows system’s clipboard, beyond its default capability and the disadvantage that you can only copy once before pasting. The next time you copy or cut another snippet, you overwrite the existing clipboard contents. CodeRush helps to keep the clipboard history that you can use to paste any selected fragment again. You can have up to 64 independent fragments and work with each of them separately, persisting these fragments across Visual Studio sessions for future use. If you copy a code fragment, Clipboard History will maintain its syntax highlighting as well:
Read more…
To persist your data using the DecoupedStorage object, use the appropriate ReadXXX and WriteXXX methods. In case your settings are language dependant, DecoupledStorage includes a property “LanguageID” that can create and select child storage objects for the purposes of language-specific storage (e.g., to support independent settings for C#, C++, Basic, etc.). Just set the LanguageID to the appropriate Language identifier (e.g., “CSharp”, “C/C++”, “Basic”, etc.), and then read and write normally. To activate the language-neutral storage object, set the LanguageID to an empty string. If your code is inside a CodeRush Options Page, you can get the LanguageID through the Options page’s LanguageID property (also, you can handle the LanguageChanged event in your Options page to find out when the user wants to create settings for another programming language).
Read more…
There are only four important things to make the Action component available and working:
- Create a new DXCore plug-in if you haven’t done it yet
- Drop the Action control on the plug-in designer surface
- Fill the ActionName property
- Handle the Execute event
That’s it. Using the ActionName you are able to assign a shortcut key, and once it’s pressed, the Execute event will do its job – perform the code you added into the event handler.
Read more…
Let’s implement the Comment Density code metric using the CodeMetricProvider DXCore component. This code metric provides the ratio of comment lines to all lines and indicates the comments coverage of your source code. We are going to calculate it in percents for all type declarations like this:
Comment Density = (comment lines / code lines) * 100
The density of comments metric value will be between 0 and 100 percents, and can be used as a quality indicator to see how much of the code is commented. So, if the comment density value for instance is below a certain value defined by the project manager, it indicates that the code is under commented. Let’s assume that what’s recommended is a commenting of at least 15% of the code and a maximum of 30%.
Read more…