WishList: New refactoring items in VS.NET IDE...

A

AshokG

Hi

In C# I wish to add the follwong refactoring:

Promoting constructor parameter (of a class) to field :(property) by
assigning the value of the parameter to field in the ctor body

Example

class GraphicChar()
{
public GraphicChar(char c, string fontFace)
{

}
}

If I select fontFace parameter and choose to "Promote Parameter To Field"
then it should do like this

class GraphicChar()
{
string fontFace;

public GraphicChar(char c, string fontFace)
{
this.fontFace = fontFace;
}

}

or If I choose to "Promote Parameter To Property" then

class GraphicChar()
{
public GraphicChar(char c, string fontFace)
{
this.FontFace = fontFace;
}

string fontFace;
public string FontFace
{
get { return fontFace; }
set { fontFace = value; }
}
}


Don't you think is helpfull ? :)

Regards,
Ashok
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Yes, I do. especially promoting the constructor parameters to fields. Also
the contrary will be helpful, to be able to create a new consrtuctor with
all the fields in the class.

There is a link in MSDN where you can suggest improvement to the IDE, I do
not have the link here with me though, maybe somebody else will post it.
 

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