Programming languages such as C# and Visual Basic support the creation of XML Documentation Comments, allowing developers to quickly annotate and document their source code to keep the documentation in a standard format and to gain benefit from the information as you code. Documentation is important to ensure that developers can quickly learn and use the source code.
Read more…
A property without a ‘set’ accessor is considered read-only:
Read more…
When working with arrays and lists enumerating all of its items we usually create a for loop statement as follows:
Read more…
You might have already learned that CodeRush suggests several code issues that highlight the switch (Select in VB) statement with hints and warnings when it has suspicious code. For example, when the switch statement handles only a subset of the possible enumeration values it is checking for, this may be a sign of incomplete code.
Until recently, there were no code fixes of those code issues. Now, they appear:
Read more…
There are two actions added to repeat the last operations:
- SmartTagExecuteLast – executes the last code or refactoring provider performed. This one is useful is you’d like to apply a specific refactoring several times in a row. The default shortcut for this action is Ctrl+Alt+Y (inspired by the Redo operation shortcut – Ctrl+Y).
- NavigateLast – executes the last navigation provider. Useful for navigating forward and backward using the specific navigation provider. For this action, there’s no default shortcut yet – if you have any ideas, please share them in the Comments section to this post.
—–
Products: DXCore, CodeRush Pro
Versions: 12.1 and up
VS IDEs: 2008 and up
Updated: Apr/19/2012
ID: U012
NOTE: please take into account the “Versions” field at the bottom of the post, to determine the build number for which the content is applied. Click here to see the latest officially released version.
The Smart Constructor CodeRush feature allows you to add constructors to the current class or structure, and pass type members, like fields and properties for initialization through its parameters. To choose fields and properties that will be passed to a new constructor, the following dialog is used:
Read more…
The Create Descendant and Create Descendant (with virtual overrides) CodeRush code providers are now available not only on the type declaration but on any reference to a type inside source code, for example:
It allows to create derived classes without navigating to the declaration of the ancestor class.
—–
Products: CodeRush Pro
Versions: 12.1 and up
VS IDEs: 2008 and up
Updated: Mar/24/2012
ID: U005
Objects can be converted from one type to another, assuming that the types are compatible. Often this is achieved using implicit conversion or explicitly with the cast operator. To perform an explicit casting, there are two approaches used:
- a cast-expression
- an ‘as’ operator
Read more…