coderushforroslyn-400442-refactoring-assistance-pull-member-up.md
Moves a member with its dependencies to a base type.
Available when the caret is in a type member. The base type code should exist in the current solution.
Note
This refactoring is not available for interfaces.
Place the caret in a member declaration.
Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
Select Pull Member Up from the menu. If there are several base types in the current solution, you can select the target type from the submenu.
After execution, the Refactoring moves a member with its dependencies to a base type.
class BaseClass {
public void IncrementValue(int interval) {
Value += interval;
}
public int Value { get; set; }
}
class MyBaseClass : BaseClass {
}
class MyClass : MyBaseClass {
}
Class BaseClass
Public Sub IncrementValue(ByVal interval As Integer)
Value += interval
End Sub
Public Property Value As Integer
End Class
Class MyBaseClass
Inherits BaseClass
End Class
Class [MyClass]
Inherits MyBaseClass
End Class