سؤال

I have a large class from which I want to extract interface.

I only found "Extract Method" under Refactor Option, so I am wondering if there is any free tool available that does that, so I do not have to create the interface by hand?

هل كانت مفيدة؟

المحلول

I am answering my own question for other users with the same problem.

After looking around the web I came across SharpDevelop which is The Open Source IDE for .NET and it has some features that are missing in Visual Studio Express.

One of those features is also Extract Interface.

نصائح أخرى

I do it through Resharper, but it can be done natively in VS through Class Designer. From here:

To extract members to a new interface

In Class Designer, right-click the type that contains the member or members you want to extract, point to Refactor, and click Extract Interface.

The Extract Interface dialog box displays default values for the name of the interface and the name of the code file in which it will be declared. Either accept the default values or change them.

In the Select public members to form interface pane, select or clear the check box next to the members you want to extract into the new interface, and click OK.

A new interface is created, and the file that houses it is added to the project.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top