Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Encapsulate field and C++/CLI Properties

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Alban Posted - Feb 20 2015 : 04:54:54 AM
Hi,

I'm using Native C++ and C++/CLI classes.

I love the Encapsulate Field Refactor command, that works as a charm by generating methods for Native classes, but on C++/CLI I would like to generate Properties.

I tried to add a "Refactor Encapsulate Field as Property" snippet, but it doesn't show in refactor menu.
Replacing the "Refactor Encapsulate Field" snippet by my code however works.

If I only used C++/CLI classes, that would do the job, but since I'm always switching from native and managed, I'm searching for a mean to have access to both features.

Is there any way to do that ?
- Add a new VA Snippet to Refactor menu ?
- Add a keyboard or quick menu shortcut to trigger this new refactor snippet on a selection ?

Any idea ?

Thanks !
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 23 2015 : 1:39:07 PM
I don't have any estimate yet for when this might be done, but this thread should be updated if and when this is done. It should be quite helpful, but its one of several enhancements we are considering, and things have to be done one at a time.
Alban Posted - Feb 23 2015 : 02:01:31 AM
Hi,

Thanks for your help. I'll try your suggestion.

I hope this feature will be available soon.

Regards

Alban
feline Posted - Feb 20 2015 : 2:36:14 PM
Unfortunately you cannot create new commands by adding a snippet, as you have found. The refactoring snippets are there to help you control the refactoring commands, but extra work has to go on in the background to enable the reactoring to work.

Here you either need to swap between two different sets of code for the Encapsulate Field snippet, as you move between C++ and C++/CLI, or use a separate snippet for one of these two languages. Perhaps starting with:

void Set$AccessorName=$clipboard$$($dataType$ data) { $clipboard$ = data; }
$dataType$ Get$AccessorName=$clipboard$$() { return $clipboard$; }


something similar would help here. Here the thinking is that the member variable is in the clipboard, and you can then use this as the start point for the function names. You still need to enter the variable type, but you can use the clipboard history menu to help here, if you copy this before copying the variable name.

We are considering adding the ability for normal snippets to work out and insert the type of a variable, but I don't currently have an estimate for when this might be done:

case=5472

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000