Nullable Type CodeRush Template
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
Then locate the DevEx node and expand it, then open the XPO node.
Click on the New Template button ![]()
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)
Now in the “Expansion” section put
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
Your Editor > Line node should look like this
Then down the bottom in the Dependent Namespaces section put
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
Latest Comments
- Simple Collection to...
Hey Norman, Keep in mind that Baritem ar... More... - Simple Collection to...
Great many thanks - this said, I'm looki... More... - Simple Collection to...
I just checked my class here and it stil... More... - Simple Collection to...
I'm using Winform DevExpress Library - a... More... - XPO ObjectLayer Tuto...
Cheers Glen, I have held off continuing ... More...





