Intelliprompt info from XML file

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by ernesto
Avatar
Actipro

(1)
Do you have an example of populating the IntelliPrompt ParameterInfo from an XML file?
The language I am writing the editor for is not a .net language, but a custom language of simple English commands and very few parameters.
Example command: ANGLE
Example param: x1;y1;z1;x2;y2;z2;\100;\201
That is all for one of the commands, nothing fancy at all.

This example shows all that I really need to get the prompt to show up, but I would like to efficiently pass Parameter Info from the XML file into the Add method.

Dim offset As Integer = Editor1.SelectedView.Selection.EndOffset
Editor1.IntelliPrompt.ParameterInfo.Info.Clear()
Editor1.IntelliPrompt.ParameterInfo.Info.Add(("void Control.Invalidate()<br/>" + "Invalidates the entire surface of the control and causes the control to be redrawn."))
Editor1.IntelliPrompt.ParameterInfo.Info.Add(("void Control.Invalidate(System.Drawing.Rectangle rc, bool invalidateChildren)<br/>" + "rc: A System.Drawing.Rectangle object that represents the region to invalidate."))
Editor1.IntelliPrompt.ParameterInfo.Show((offset - 10))

(2)
How do I get the following KeyPressTrigger to pop up the IntelliPrompt automatically or do I need to still use the above code to do it from the Editors KeyTyped event?


<Triggers>
<KeyPressTrigger Key="MemberListTrigger" Character=" ">
<KeyPressTriggerValidStates>
<KeyPressTriggerValidState State="DefaultState" />
</KeyPressTriggerValidStates>
</KeyPressTrigger>
</Triggers>

(3) Is using an XML file for this stuff the best (most efficient) approach?

thanks
teamels

Comments (5)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi,

1) For parameter info, that is the correct way to do it. For member lists though, using AddRange and adding all your items at once will be fastest as opposed to adding them one at a time. With member list items you should always build your items collection first and add it with one AddRange call for maximum performance.

2) You would still have to handle the trigger and use your code in #1 to show the IntelliPrompt.

3) Really you can store data for IntelliPrompt however you want. In our .NET Languages Add-on, we store reflection data for types in cache files and documentation data in other cache files. Then we combine them at run-time as needed to provide the colorful prompts. XML format will work but is slow for searching. Using a binary format will be smaller and faster for lookup if you index it properly.


Actipro Software Support

Posted 17 years ago by ernesto
Avatar
Thanks,

I see now that I had mistaken the List and Parameter Info to be the same thing (Duh!)
The Parameter Info prompt is all that I need. I do not have any types to list as we only have about a 100 or so commands with very few parameters.

thanks
teamels

[Modified at 12/22/2006 11:03 AM]
Posted 17 years ago by ernesto
Avatar
1.) I have my language syntax coloring xml file working to show my Key words in color. Now how do I capture those key words as I type in the editor to then use them against my binary file to see if there is a match so I can populate the parameter info prompt ?

2.) I need to read in my binary file after I capture the key word typed, what is best to use a Collection, Array or IDictionary to store the key words and parameter info into to match against?


thanks for any help
teamels

[Modified at 01/25/2007 12:00 AM]

[Modified at 01/25/2007 12:02 AM]

[Modified at 01/25/2007 12:18 AM]
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You can use a TextStream (via Document.GetTextStream) to scan the tokens when a key like '(' is pressed so you can see what tokens are around the caret.

Once you identify the keyword, then look it up in a table. A Hashtable or HybridDictionary are good choices for a data structure.


Actipro Software Support

Posted 17 years ago by ernesto
Avatar
Excellent, thank you I will give it a shot.

This is why I like you guys. You respond quickly, very important to any company.

thanks
teamels

[Modified at 01/25/2007 11:19 AM]
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.