Fields to Properties

Jul 24, 2009
by:   Tim Stanley

How to automatically have Visual Studio 2008 convert fields to properties.

Type the following:

public String _Title;

Right click the “_Title”, select Refactor, Encapsulate Field…

image

Select the new Property name:

image

After Visual Studio Encapsulates the field, Select Apply

image

Visual Studio will generate the new property.

image

Add to favorites Send to a friend Digg It! DZone It! StumbleUpon Technorati Reddit Del.icio.us NewsVine Furl BlinkList