Anonymous types are type declarations that are generated automatically by the compiler without having to explicitly declare it. They provide a convenient way to encapsulate several read-only properties into a single object that is not declared in the code. Anonymous types are supported by C# and Visual Basic programming languages starting from Visual Studio 2008.
Read more…
Implicitly-typed local variables are variables declared without specifying the type explicitly. The type of such variables is being inferred from the expression that is used to initialize the variable at the time the code is compiled. Implicitly-typed variables are really useful for LINQ that creates anonymous types in queries, and for which you want to assign variables. However, implicitly-typed locals can be used with any variable declaration to enhance the readability, for example:
Read more…
The Decompose Parameter refactoring splits a single parameter into one or more parameters, depending on the function of the original parameter. The refactoring analyzes how the parameter is used and which of its properties are accessed, after which it can replace a single parameter into several others of the appropriate type for each property being accessed through the original parameter.
Read more…
In addition to the refactorings that work with the concatenated strings and the String.Format call, there is another useful refactoring called Use StringBuilder. This refactoring replaces the string concatenation operations with corresponding methods of the StringBuilder class.
Read more…
Refactor! Pro provides several refactorings to create and organize the .NET String.Format call. The String.Format call is a static method that receives a string that specifies where the following arguments should be inserted, and how they should be formatted. You can specify the display options for each argument individually using the String.Format call.
Read more…
Refactor! Pro has many refactorings that are divided into several categories for clarity. One of the categories is Interfaces, where you can see the list of refactorings and code providers that are specific to interface declarations. The category is not as large as others at the moment, however, you might find these refactorings useful.
Read more…
The Add to Interface code provider adds the active member declaration to the specified interface that is implemented by the current type. You can choose the target interface via the sub menu inside the Refactor! popup menu:
Read more…
There are two refactorings specific to the C++ language:
- Move Method to Source File
- Move Method to Header
Read more…