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