"Refactoring is the process of changing a software system
in such a way that it does not alter the external behavior of the
code yet improves its internal structure."
Martin Fowler
SharpDevelop supports the following refactorings.
- Rename - you can rename a variable, class, method,
field or property and all references to it are updated.
- Remove unused import statements - removes all the
unused using or import statements from the current file.
- Extract method - creates a new method from the
selected lines of code.
Given the code:

You decide that the Count property is badly named and you want
to change it, but it is used in several other classes. Right click
the Count property and under its name in the menu select
Rename.

This opens the Rename dialog box.

Type in a new name for the property and click the OK
button. This renames the property and updates all the code that
uses this property.
To remove any unused import statements from the currently open
file, select Remove unused import statements from the
Refactor menu.

Given the code:

You decide that the code inside the constructor should be
extracted into its own method. Highlight the lines of code you want
to extract.

From the Refactor menu select Extract Method.

In the Extract Method dialog give the method a name and
click the OK button.

Then a new method will be generated as shown below.

< previous |
home |
next >