Coding Helpers – Reverse For Loop
When working with arrays and lists enumerating all of its items we usually create a for loop statement as follows:
When working with arrays and lists enumerating all of its items we usually create a for loop statement as follows:
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.
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:
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:
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:
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.