Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 C# win 表单,用作我的应用程序的 GUI。在表单代码中,我编写了表单事件使用的所有公共方法。现在我需要将所有这些公共方法重构为另一个静态类。我研究了 7 种重构 VS2010 内置的方法(参见此处)。我也使用了 Extract 接口方法,但是在初始化之前我仍然需要实现一个接口方法。我的问题是;Visual Studio 2010 中是否有任何功能可以执行此操作?像这样
Visual Studio 不支持提取类重构。最新版本的 ReSharper 可以。
1 - 静态类不能实现接口,所以排除这种可能性。
2-你不能模拟静态类。
VS 2010 没有提取类重构技术,因此您需要考虑使用 ReSharper 或其他重构工具