T O P I C R E V I E W |
John_H_Bergman |
Posted - Aug 10 2006 : 11:19:56 AM I'd like to see the ability to right-click on a field (C#) that is define like
private int m_iXXXXXXX;
and encapsulate access with a property. |
5 L A T E S T R E P L I E S (Newest First) |
sean |
Posted - Sep 01 2006 : 2:35:40 PM It turns out the default autotext item for C# Refactor Encapsulate Field looks like what you want it to be - but there is a bug in adding the default per language items. |
d_p_robinson |
Posted - Sep 01 2006 : 08:06:02 AM I hadn't spotted this before I posted an identical suggestion to the Beta forum. Using properties is preferable to accessor methods because it's a well-known idiom and is supported by the IDE as such. |
feline |
Posted - Aug 12 2006 : 3:35:41 PM i have done a small amount of C#, and have yet to work out when you should have a property rather than a normal pair of accessor methods, so for consistency i would have thought always using properties was easier, so you only need one autotext rule. |
sean |
Posted - Aug 10 2006 : 11:30:19 PM The workaround autotext item would be to modify Refactor Encapsulate Field (in C#) to be:
$end$public $SymbolType$ $GeneratedPropertyName$ { get { return $SymbolName$; } set { $SymbolName$ = value; } }
Does it makes sense to add a separate refactoring for this?
|
rhummer |
Posted - Aug 10 2006 : 10:39:24 PM This would be very handy, as the current workaround would be to modify the Refactor Encapsulate Field to have a get/set pair in the methods.
case=2030 |