is there a way to use Visual Studio IDE to generate Properties?

M

MrNobody

I am used to using Java's Eclipse IDE where I can choose one or more fields
and have the IDE automatically generate getter and setter methods for it.

Is there something in the Visual Studio IDE where I can select a field like
"string name;" and automatically generate a Property for it?
 
I

Ignacio Machin ( .NET/ C# MVP )

I am used to using Java's Eclipse IDE where I can choose one or more fields
and have the IDE automatically generate getter and setter methods for it.

Is there something in the Visual Studio IDE where I can select a field like
"string name;" and automatically generate a Property for it?

Hi,

I do not know if visually you can do it, in the code you right click
over the variable and select Refactor and there is an option to create
the property. You also can use Ctrl+R , Ctrl+E to do the same
 
C

Cowboy \(Gregory A. Beamer\)

That option only works on one property at a time, unless there is some
change I do not know of.

With VSPropertyGenerator2, you can specify all of the private variables and
generate properties in one fell swoop.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
message
I am used to using Java's Eclipse IDE where I can choose one or more
fields
and have the IDE automatically generate getter and setter methods for it.

Is there something in the Visual Studio IDE where I can select a field
like
"string name;" and automatically generate a Property for it?

Hi,

I do not know if visually you can do it, in the code you right click
over the variable and select Refactor and there is an option to create
the property. You also can use Ctrl+R , Ctrl+E to do the same
 
C

Cowboy \(Gregory A. Beamer\)

Not if you want to create multiple properties at one time, unless there is
something you know that I do not.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
message

You do not neeed some extra, it is already part of the IDE
 
M

MrNobody

Cowboy,

Thanks for the suggestion!

I tried downloading their version for VS 2005 (since it seems to be the
latest one) and I followed the instructions by extracting those two files
into their appropriate folders (I had to create the folders - they did not
exist) but the option is not showing up under my Tools menu... do you
remember what you had to do to get this working in VS 2008 ?



Ignacio,

What is the current functionality in the IDE for this?

How is it initiated? I can't find it anywhere... I found something for
VB.NET though, but not C#. One of the code snippets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top