Archive

Posts Tagged ‘Types’

Code Issues hints for types and members

September 28th, 2012 Comments off

Here are the suggestions (hints) code issues which might improve the readability, clarity and performance of your source code.

Read more…

Code Issues specific to declaring types

August 9th, 2012 Comments off

The CSharp and Visual Basic programming language specifications have several restrictions on how type elements such as a class, structure, and delegate are declared in the code. Let’s review code issues that demonstrate an incorrect type declaration, and see the error before the compiler informs us about it when we build the code.

Read more…

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…

Changing an explicit cast-expression to an ‘as’ operator and back

February 16th, 2012 Comments off

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…

New navigation provider – Type instantiations

January 26th, 2012 Comments off

Starting with the next minor update v2011 vol2.8, there’s a new navigation provider available: Jump to Type Instantiations.

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…

CodeRush Code Issues for interfaces

October 24th, 2011 Comments off

An interface is a code structure that has no concrete members and similar to an abstract class. An interface can contain public members such as methods, events, properties and indexers, but these members do not provide any functionality. Instead, they define items that must be made concrete within all classes that implement this interface. This means that an interface can be used to define what a class must do, but not how it will achieve it.

Read more…

CodeRush code issues specific to constructors

September 29th, 2011 Comments off

A constructor is a special class member that is executed when a new object is created. There are two types of constructors: instance constructors and static constructors. Instance constructors are used to create and initialize instances of classes or structures. A static constructor is used to initialize a class itself. A static constructor is called automatically to initialize the class before the first instance is created or any static members are invoked.

Read more…