Detect icon dynamically.

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Joe
Version: 4.0.0284
Avatar
Hi!
That's part of your Simple-AddOn Language.

memberListItemHashtable["function"] = new IntelliPromptMemberListItem("function", (int)ActiproSoftware.Products.SyntaxEditor.IconResource.Keyword);
Now I'd like to detect the icon I use dynamically.
It should depend on the return value of my function. Functions with number expressions should have different icons than functions with string expressions.
Can you follow me? Do you have any idea how I can solve this?

Regards, Joe

Comments (3)

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

To do that sort of thing, you'd want to look at the data in your CompilationUnit. Find the function declaration and see what it returns, then change your icon based on that. You can see that the compilationUnit variable is already loaded up for you in the method you mentioned. So as long as you build the return type data into your CompilationUnit, that's the way to go.


Actipro Software Support

Posted 14 years ago by Joe
Avatar
Hi!
Thanks for your first answer. Unfortunately I have not solved the problem yet.
My problem is that I implemented functions which are loaded if I start my application. I think these functions are not listed in the CompilationUnit, right? So I can't get a return type of this functions.
Do you know how I could solve this problem?

Regards, Joe
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Joe,

Document parsing and subsequent compilation updates will happen any time the document changes or a language is set. So yes, they should be getting built for your initial document text. However note that the parsing generally occurs in a separate thread so you may not immediately be able to access the results in your Form constructor. There is a SyntaxEditor.DocumentSemanticParseDataChanged event you can subscribe to that fires when it does get updated though.


Actipro Software Support

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.