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
 Technical Support
 C# Encapsulate Field as property
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

d_p_robinson
Junior Member

United Kingdom
21 Posts

Posted - Sep 01 2006 :  08:02:16 AM  Show Profile  Reply with Quote
The default C# Encapsulate Field generates code that is identical to C++. A suggested improvement is:

$end$public $SymbolType$ $GeneratedPropertyName$
{
get { return $SymbolName$; }
set { $SymbolName$ = value;}
}

This generates code for a read/write property rather than the default autotext that generates separate set and set operations.

rhummer
Tomato Guru

USA
527 Posts

Posted - Sep 01 2006 :  08:53:20 AM  Show Profile  Reply with Quote
already beeng requested

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 - Sep 01 2006 :  2:28:24 PM  Show Profile  Reply with Quote
d_p_robinson: What build are you using? Did you have an earlier beta build installed at some point? If you delete the default C# autotext item for Encapsulate Field and then try the Refactoring can you please post the default C# autotext item that is automatically generated?
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 01 2006 :  3:35:48 PM  Show Profile  Reply with Quote
There was a bug in the way the default autotext items were loaded during install. This is fixed for the next build. In the meantime, just delete any default C# Refactor autotext items that you haven't modified. They will be restored properly when you actually use them.
Go to Top of Page

d_p_robinson
Junior Member

United Kingdom
21 Posts

Posted - Sep 04 2006 :  04:36:16 AM  Show Profile  Reply with Quote
I'm using build 1533. Deleting and then using the refactor autotext does as you say and regenerates the desired code.
Thanks,

David
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