Archive

Posts Tagged ‘Consume-first declaration’

The Create Descendant code provider availability change

March 23rd, 2012 Comments off

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:

CodeRush Create Descendant available on a reference

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

New option for positioning newly declared types

March 23rd, 2012 9 comments

An options page for type declarations positioning has been introduced. You can change the target position for classes, structures and interfaces created by CodeRush code generation code providers:

CodeRush Type Declarations options page

Read more…

Declaring fields using CodeRush consume-first declaration features

December 16th, 2011 Comments off

Unlike the local variable declarations, fields are simply variables that are declared directly within the code block of a class or a structure. Fields are declared in the type block by specifying the access level of the field, the type of the field and the name of the field. A field may also include a readonly modifier. This type of field can only have its value set directly in its declaration or from within a constructor of its containing class.

Read more…

Declaring locals using CodeRush consume-first declaration features

December 16th, 2011 Comments off

Local variable declarations are the most often used types of declarations in code. A local variable is a type of variable declared by local variable declaration inside a block the variable is intended to be local to. The local variable declaration explicitly defines the type of the variable that has been declared along with the identifier that names the variable. You can also declare implicitly typed local variables, whose type is inferred by the compiler from the expression.

Read more…

Declaring enumeration types and its elements in CodeRush

December 14th, 2011 Comments off

An enumeration type is a special set of related constants, each with an integer value. Enumerations are useful for defining states and sequences, particularly when there is a natural progression through those states. Each constant in the enumeration list can be compared and formatted using either its name or value. For example, assume that you have to define a variable whose value will represent a day of the week. There are only seven meaningful values which that variable will ever store. To define those values, you can use an enumeration type.

Read more…

Code Gen – Declare Struct

November 5th, 2010 Comments off

Declare Struct code provider generates a structure for the current type reference to a non-existent type. If the type reference on the editor caret creates a new instance of a non-existent type that takes some arguments, the appropriate constructor is generated for the new structure:

CSharp:

CodeRush Declare Struct

Read more…

Code Gen – Declare Class

November 5th, 2010 Comments off

Declare Class code provider generates a class for the current type reference to a non-existent type. If the type reference on the editor caret creates a new instance of a non-existent type that takes some arguments, the appropriate constructor is generated for the new class.

CSharp:

CodeRush Declare Class

Read more…

CodeRush Xpress declaration features

July 6th, 2010 Comments off

CodeRush Xpress includes powerful features to intelligently declare types (classes, structures, interfaces), members, fields, local variables and so much more.

Add Contract

This feature automates the very common task of checking the parameters to a method, to make sure that all have been initialized. Having all the parameter values checked for initialization in one place at the top of the method body results in clearer code . This also allows you to provide a centralized response to invalid parameter values, if needed.

Read more…