Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Refactor to Property
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

John_H_Bergman
Tomato Guru

USA
198 Posts

Posted - Aug 10 2006 :  11:19:56 AM  Show Profile  Reply with Quote
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.

John H. Bergman
CTO
SiliconZone


[email protected]

To Send email, remove the .online.

rhummer
Tomato Guru

USA
527 Posts

Posted - Aug 10 2006 :  10:39:24 PM  Show Profile  Reply with Quote
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

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Aug 10 2006 :  11:30:19 PM  Show Profile  Reply with Quote
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?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Aug 12 2006 :  3:35:41 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

d_p_robinson
Junior Member

United Kingdom
21 Posts

Posted - Sep 01 2006 :  08:06:02 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 01 2006 :  2:35:40 PM  Show Profile  Reply with Quote
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000