Jul
05
2011

Nullable Type CodeRush Template

User Rating: / 1
PoorBest 

Just a quick one,

Incase anyone is use to using the xp?type? template within CodeRush for XPO properties, there is a handy shortcut with CodeRush for Nullable types for standard properties, p?type?0.

However DX seemed to miss this when creating the XPO template.

You can quickly add it yourself if you wish just head to your DevExpress > Options menu

 

Head to the Editor > Templates section on the left Tree

 

image

Then locate the DevEx node and expand it, then open the XPO node.

image

Click on the New Template button image

enter in the name as xp?Type?0
(NOTE: the title of the dialog should have – XPO at the end, if not you are creating the template somewhere else, make sure you have the XPO node open and selected before clicking the new template button)

image

Now in the “Expansion” section put

image

Then in the Use section locate and tick the following

Editor > Code > InClass

Editor > Line > OnEmptyLine

while still in the Use section locate and cross the following (this is ticking it twice will give it a “cross”)

Editor > Code > InComment

Editor > Code > InMethod

Editor > Code > InProperty

Editor > Code > InStaticClass

Editor > Code > InString

So your Editor > Code node should look like this

image

Your Editor > Line node should look like this

image

Then down the bottom in the Dependent Namespaces section put

image

And now you can create Nullable types for XPO.

I have placed a suggestion at DX to have this included with CodeRush in future, we’ll see what happens. http://www.devexpress.com/Support/Center/p/S137715.aspx

EDIT: Forgot I already put this suggestion in a while back with http://www.devexpress.com/Support/Center/p/S135507.aspx, in there I also list the xr?Type?, template which allows you to put in a ReadOnly XPO property without a backing field.

EDIT EDIT: In case you missed it this is a list of the main XPO templates in CodeRush http://www.alfware.com.au/component/content/article/1-blog/20-coderush-is-your-best-friend-for-xpo


Add comment

Although I believe your free to say what you want, please don't abuse either myself or other peoples, be constructive.


Security code
Refresh

Latest Comments

My Twitter

Follow me on twitter