ReSharper 8.0 Web Help

Safe Delete

One of the important parts of any refactoring is to remove the old code safely. The Safe Delete refactoring is available in Visual Basic and removes not only declarations, but also all references if necessary.
ReSharper_by_Language__Visual_Basic__Refactorings__Safe_Delete_01
ReSharper also asks whether you want to delete the whole hierarchy of members or just single member.
ReSharper_by_Language__Visual_Basic__Refactorings__Safe_Delete_02

Make Shared

If a function doesn't use any type members, it can be made Shared. Luckily there is a necessary refactoring provided by ReSharper.
ReSharper_by_Language__Visual_Basic__Refactorings__Make_Shared_01
ReSharper offers you to choose between adding this parameter to the method signature and leaving it as is.
ReSharper_by_Language__Visual_Basic__Refactorings__Make_Shared_02
As a result, the function becomes shared.
ReSharper_by_Language__Visual_Basic__Refactorings__Make_Shared_03

Convert Method to Property

This refactoring converts Sub procedures to write-only properties and Function procedures to read-only properties. To convert a Sub procedure to a write-only property apply the Convert Method to Property refactoring:
ReSharper_by_Language__Visual_Basic__Refactorings__Convert_Method_to_Property_01
Specify a property name or leave it as is, then click Next in the Convert Method To Property dialog box.
ReSharper_by_Language__Visual_Basic__Refactorings__Convert_Method_to_Property_02
If there are no conflicts, refactoring will be applied and all appropriate changes will be made. Otherwise, you should resolve the conflicts or cancel the refactoring.
ReSharper_by_Language__Visual_Basic__Refactorings__Convert_Method_to_Property_03
To convert a Function procedure to a read-only property, also use this refactoring.

Extract Class

Since ReSharper 7.1 the Extract Class refactoring is available for VB.NET as well. This refactoring allows you to create a new class with members of some existing class. For more information, see Extract Class.

Move to Resource

Working with resources in Visual Basic is also available.
ReSharper_by_Language__Visual_Basic__Refactorings__Move_to_Resource_01
Select a string that should be moved, specify a name for a new resource entry, a resource file where it should be moved, change a value or add a comment if necessary.
ReSharper_by_Language__Visual_Basic__Refactorings__Move_to_Resource_02
If ReSharper finds identical items, it prompts you to choose which of them to affect.
ReSharper_by_Language__Visual_Basic__Refactorings__Move_to_Resource_03
After applying the refactoring specified occurrences are replaced with corresponding resource usages.
ReSharper_by_Language__Visual_Basic__Refactorings__Move_to_Resource_04
And a new resource declaration appears in the appropriate .resx file.
ReSharper_by_Language__Visual_Basic__Refactorings__Move_to_Resource_05

Inline Resource

To replace resource usages with its value and remove corresponding resource declarations, apply the Inline Resource refactoring.
ReSharper_by_Language__Visual_Basic__Refactorings__Inline_Resource_01
By default, all usages and declarations are affected, but if you clear the Inline all usages and Remove declaration of inlined resource check boxes, only the current resource usage will be inlined.
ReSharper_by_Language__Visual_Basic__Refactorings__Inline_Resource_02

Other useful refactorings to work with resources: Move Resource, Rename Resource and Safe Delete Resource.

See Also

Procedures: