提取基类的工具?

Ste*_*e B 6 c# refactoring visual-studio-2010

如果我有这样的C#代码:

public class A {
    public string PropA { get; set; }
    public string PropB { get; set; }

    public string PropZ { get; set; }

}

public class B {
    public string PropA { get; set; }
    public string PropB { get; set; }

    public string PropX { get; set; }
    public string PropY { get; set; }

}
Run Code Online (Sandbox Code Playgroud)

作为PropAPropB同时存在于类,并具有相同的含义,我想重构是这样的:

public abstract class Base {
    public string PropA { get; set; }
    public string PropB { get; set; }
}

public class A : Base {
    public string PropZ { get; set; }

}
public class B : Base {

    public string PropX { get; set; }
    public string PropY { get; set; }

}
Run Code Online (Sandbox Code Playgroud)

使用VS 2010,是否有任何工具/扩展允许我快速执行此操作?实际上,我的实际代码包含几个类中的许多属性,而不是相同的顺序.正确分解代码可能会有点痛苦...这就是为什么我在寻找一种懒惰的方法来做这件事

Dan*_*rth 2

您可以将Resharper与“提取超类”一起使用。