Windows Phone Developers

Sunday, April 27, 2008

Extract Interface from Custom Class (C#)

How to Extract Class Members to Interface in C#

You can extract one or more public members from a type into a new interface.

To extract members to a new interface

1. 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.

2. 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.

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005