Snippet Function Element

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Hi,
I was looking through the snippets that come with vs2005 and I came across the function tag in a couple of the snippets. Is it on your list of items to implement? I imagine that the function name could be keyed to a delegate in a hashtable that would do the expansion. So when a user enters a text field that would trigger a function you would look up whether the hashtable has a key for the function name, then you could implement the delegate.

thanks,
Jake

Comments (4)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It seemed like VS.NET 2005 was hardcoded with some of the function handling functionality. But if you want to post some specifics on how you'd like to see something work where you could handle them yourself in SyntaxEditor, we'd be happy to look at your specifications and discuss them.


Actipro Software Support

Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
We are just getting started defining the snippets for our application, so I don't have an idea of what I want yet. I will post if I come up with any idea.

Besides functions, there is one idea I have that would be great for our users. Basically, a drop down list below a field of suggested values. For example, lets say there is a snippet like this:
DoSomething($objectName$);
A user inserts the snippet. When the $objectName$ token gets focus, you call a virtual function in the SyntaxEditor that looks like this:
protected virtual IntelliPromptMemberList GetSyntaxLiteralSuggestions(CodeSnippet snippet, CodeSnippetDeclaration declaration);
I would then override the function if I wanted to give a list of possible values for the declaration. You would then display the intelliprompt if I give you one. And replace the declaration value if the user chooses a value.

thanks,
Jake

[Modified at 10/19/2005 12:02 PM]

[Modified at 10/19/2005 12:02 PM]
Posted 18 years ago by Ashton - Developer, Schema Solutions LLC
Avatar
I actually do this with SyntaxEditor.

I handle the OnCodeSnippetFieldActivated event and in there I look at e.DeclaratorID matches whatever field I'm looking for (ie. in my case "procedure"), I will show a list of procedures to the user using the IntellipromptMemberList.

Thanks,
Posted 18 years ago by Jake Pearson - Software Developer, Alion Science and Technology
Avatar
Thanks for the tip.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.