Home > Refactorings > Refactorings for Loops and Blocks overview

Refactorings for Loops and Blocks overview

August 28th, 2012

This is just a quick overview list to organize a bunch of refactorings that deal with loops and blocks. Click the refactoring name to learn more about it.

Add Block Delimiters

This refactoring embeds a single statement into curly braces.

Consolidate Using Statements

This refactoring combines several neighboring or nested using statements that cover variables of the same type into a single using statement.

Create With Statement

This refactoring creates a With statement (Visual Basic) for the selected object from the selected code.

For to ForEach

This refactoring converts the for-loop that iterates over items of a collection or array into the simpler foreach-loop.

ForEach to For

This refactoring converts the foreach-loop into a for-loop.

Inline With Statement

This refactoring inlines the expression of the With statement (Visual Basic) back into the source code.

Introduce ForEach Action

This refactoring convert the foreach-loop iterating the generic list into a ForEach call of the generic list instance.

Introduce Using Statement

This code provider declares a using statement for the specified IDisposable implementer, removing the call to Dispose() if it exists.

Lock to Try/Finally

This refactoring converts the lock statement into its equivalent code with try/finally block.

Remove Block Delimiters

This refactoring removes optional curly braces if appropriate.

Split Using Statement

This refactoring breaks the multi-declaration using statement into two or more neighboring using statements.

Split With Statement

This refactoring splits the With statement (Visual Basic) into two With statements.

Using to Try/Finally

This refactoring converts the selected using statement into a try/finally block.

Products: CodeRush Pro
Versions: 12.1 and up
VS IDEs: 2008 and up
Updated: Aug/29/2012
ID: R067

Similar Posts: