Archive

Posts Tagged ‘Inversion’

Coding Helpers – Reverse For Loop

August 9th, 2012 Comments off

When working with arrays and lists enumerating all of its items we usually create a for loop statement as follows:

CodeRush Reverse For Loop code sample

Read more…

Converting methods to functions or procedures

October 31st, 2011 Comments off

The simplest type of method is one that performs a task without requiring any parameters and without returning any information – let’s call them procedures (or void methods). Methods that use some type as the return value – are functions.

Sometimes, when we declare a method with a return value, we may realize that we don’t actually need this return value, and instead, need a simple void method that does not return anything. On the other hand, we marked a method as void, but may require it to be a function, returning a value.

Read more…

DXCore Components – Selection Inversion Extension

October 24th, 2011 Comments off

The Selection Inversion Extension DXCore component adds a custom intelligent selection inversion provider used by the CodeRush Selection Inversion feature.

You can drop the SeletionInversionExtension control onto your plug-in design surface from the “DXCore: Extensions & Providers” category of the Visual Studio Toolbox:

Read more…

CodeRush Invert Selection code provider

October 24th, 2011 Comments off

The Invert Selection code provider is used to apply the Selection Inversion feature of CodeRush. Once you select a block of text and there is a match with one of the predefined inversion items, the provider becomes available:

Read more…

Customizing Selection Inversion and its predefined templates

October 24th, 2011 Comments off

The Inversion options page allows you to add, modify or remove inversion regular expressions that participate in the Selection Inversion feature of CodeRush. Here is what it looks like:

Read more…

Inverting a code block into its opposite using CodeRush Selection Inversion

October 24th, 2011 Comments off

The Selection Inversion feature of CodeRush Pro allows you to invert the selected code block to the essential opposite. For example, it can invert assignments so its expression assigns the left side; for loops, so they are iterated in a different order; type cast expression, so an ‘as’ operator expression is converted into an explicit typecast, etc.

Read more…