Code Generation – Create Descendant and Create Descendant (with virtual overrides)

June 30th, 2011 2 comments

The Create Descendant code provider shipped in CodeRush generates a descendant class for the active class, providing overrides for abstract members, if any. The second version of the code provider named Create Descendant (with virtual overrides), in addition to the Create Descendant, adds overrides for virtual members into a descendant class.

Read more…

Code Generation – Create Ancestor

June 29th, 2011 4 comments

The Create Ancestor code provider generates a new base class declaration for the active class. The generated base class will be declared above the active class and the active class becomes a descendant of the new base class. The new base class has the same visibility as the active class and contains the default public parameterless constructor. All identifiers and references of the base class are linked together for easy renaming.

Read more…

Code Generation – Declare Interface

June 29th, 2011 Comments off

The Declare Interface code provider generates a new definition of an interface and adds interface referenced members to it, if any. The declaring provider is available on an undeclared type reference, that starts with an upper-case letter I, e.g. ILogger.

Read more…

DXCore Services – Key (Keyboard)

June 28th, 2011 Comments off

The Key DXCore service provides access to keystrokes, key names, and key mapping methods and properties. This service can be used for retrieving shortcuts bound to the specific actions or an entire shortcut binding scheme that you can see on the Shortcuts options page.

Read more…

Refactorings – Convert to Point

June 28th, 2011 Comments off

The Convert to Point refactoring is based on the Introduce Parameter Object refactoring with the difference that it doesn’t create a new object for parameters. Instead, it uses a ‘Point’ structure when there is a pair of two numeric parameters of a method definition are selected.

Read more…

Refactorings – Use Named Arguments

June 28th, 2011 Comments off

Named Arguments is a feature of the C# and Visual Basic languages introduced in the .NET Framework version 4.0. Named arguments allow you to explicitly specify a name for an argument for a particular parameter by associating the argument with the parameter’s name, rather than with the parameter’s position in the parameter list. Using named arguments frees you from the need to remember or to look up the order of parameters in the parameter lists of called methods.

Read more…

Code Issues specific for static classes

June 23rd, 2011 Comments off

A static class can be used as a unit of organization for sets of utility functions that operate on input parameters and do not have to get or set any internal data. These functions can be accessed without creating an instance of the class. In this case, a static class can make your implementation simpler and faster because you do not have to create an object in order to call its methods.

Read more…

How to implement the Sync Edit feature from Delphi IDE inside Visual Studio IDE using DXCore

June 22nd, 2011 Comments off

According to the Embarcadero’s docwiki:

Sync Edit mode in Delphi allows you to change all occurrences of an identifier when you change one instance of that identifier. When you enter Sync Edit mode, you can tab to each highlighted identifier in your current Code Editor window.

The difference of the Sync Edit feature in Delphi from the usual Rename refactoring from Refactor! (for example) is that a declaration of an identifier may not exist. In this case the Rename is simple not available.

Read more…