Archive

Archive for the ‘CodeRush’ Category

Code Providers – Reference Assembly

August 30th, 2012 Comments off

The Reference Assembly code provider is a simple coding helper which allows you to add an assembly reference if one does not exist for the type reference under the editor caret. The code provider is connected to the CodeRush Code Issues feature, so the editor caret should be located in the ‘Undeclared element’ code issue, for instance:

CodeRush Reference Assembly sample code

Read more…

Code Providers – Convert to Integer

August 30th, 2012 Comments off

The Convert to Integer code provider allows you to wrap an expression returning a non-integer value to Math.Ceiling, Math.Floor, or Math.Round. Consider the following code sample:

CodeRush Convert to Integer sample code

Read more…

Code providers for converting unimplemented properties

August 30th, 2012 Comments off

CodeRush has two code providers that allow you to convert unimplemented properties into a property with backing store field or into an auto-implemented property quickly:

  • Convert to Property with Backing Store
  • Convert to Auto-implemented Property

Read more…

Implementing the IDisposable pattern using CodeRush

August 15th, 2012 4 comments

The IDisposable Pattern is used to release and close unmanaged resources such as files, streams, and handles as well as references to managed objects that use unmanaged resources, held by an instance of the class. For classes that require a resource cleanup, we recommended following the IDisposable pattern, which provides a standard and unambiguous pattern. The pattern has been designed to ensure reliable, predictable cleanup, and to prevent temporary resource leaks.

Read more…

Coding Helpers – Add Initialization

August 15th, 2012 Comments off

The Add Initialization code provider inserts an initialization of the selected field or auto-implemented property to each constructor of the active type. The code provider is useful when you want to initialize those objects with a different default value:

Read more…

Coding Helpers – Add Else Statement

August 15th, 2012 Comments off

The Add Else Statement code provider performs the operation its name implies – it generates the ‘else’ statement of the current conditional statement. The ‘else’ statement is required when you want to execute a piece of code if a condition is not met. In other words, the ‘else’ is useful when an alternative case is required on the ‘if’ statement.

Read more…

Coding Helpers – Add XML Comments

August 14th, 2012 Comments off

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…

Code Issues specific for declaring variables and constants

August 9th, 2012 Comments off

In addition to code issues specific for declaring types, CSharp and Visual Basic language specifications have a few restrictions on declaring constant or simple variable declarations. Having this issue in the code editor right in front of a developer allows him to fix the issue immediately without compiling the project.

Read more…