hopefully easy refactoring exercise
I have been trying to get some team code cleaned up. I think using the refactor capability should help, but am a little unclear on how to take advantage for static variables in a class that i want to turn into a class of their own. For example:
class Common
{
public static string sDoctorSearch = "",
sDoctor_ID = "",
sDDShow = "",
sDateShow = "",
sLabels = "",
sIDType = "";
public static string sName_D = "",
sAddress_D = "",
sAddress_D1 = "",
sNotes_D = "",
sFacility_D = "",
sEmail_D = "",
sNPI_D = "",
sDEA_D = "";
Public static string otherA = "",
otherB = "",
otherC = "";
}
I want to pull some of these out to a new class called Doctor so the result would be
class Common
{
Public static string otherA = "",
otherB = "",
otherC = "";
}
class Doctor
{
public static string sDoctorSearch = "",
sDoctor_ID = "",
sDDShow = "",
sDateShow = "",
sLabels = "",
sIDType = "";
public static string sName_D = "",
sAddress_D = "",
sAddress_D1 = "",
sNotes_D = "",
sFacility_D = "",
sEmail_D = "",
sNPI_D = "",
sDEA_D = "";
}
and of course all references throughout the code updated. Is there an example of the steps to acomplish this with reSharper refactoring?
Please sign in to leave a comment.
Hello Harveyb,
There's standard ReSharper refactoring Extract Class that should provide the expected behavior, please press Ctrl+Shift+R or ReSharper | Refactor | Extract | Class.
Thank you.