Refactorings for graphics – Convert to Size
The Convert to Size refactoring from DevExpress Refactor! Pro consolidates selected numeric parameters into a System.Drawing.Size (System.Windows.Size in WPF projects) or SizeF object. It might be useful to combine two parameters into a single parameter, reducing the overall number of method parameters and increasing code readability.
The refactoring is available when two parameters are called ‘width’ and ‘height’, or parameter names end with the ‘width’ and ‘height’, for example:
All calling sides are updated correspondingly when the refactoring is performed:
The opposite of the Convert to Size refactoring is the Decompose Parameter refactoring.—– Products: Refactor Pro Versions: 12.1 and up VS IDEs: 2008 and up Updated: Mar/24/2012 ID: U007