Visual Studio 2010: Easiest way to duplicate a class?

后端 未结 7 1434
深忆病人
深忆病人 2021-01-18 19:08

Is there an easy way to duplicate a class with a different name?

7条回答
  •  北海茫月
    2021-01-18 19:43

    No, there's no refactoring tool for duplicating a class but with different name.

    I would imagine that the reason why this feature is not present is because duplicating code is generally considered a bad idea. I'd suggest instead changing your class into a base class and then make two derived classes from it, overriding methods where you need to change the behaviour.

提交回复
热议问题