SyntaxEditor Evaluation

SyntaxEditor for WPF Forum

Posted 8 years ago by Morten Overgaard
Version: 11.2.0552
Avatar

Hi,

We are evaluating the Syntax editor for use in our application. What we need is an editor which only allows c# boolean expressions to be entered. The user should be able enter enter expressions like "<person>.AgeInYears > 60" I have scanned the Documentation and have an OK understanding of the concepts, but I need an helper on where to begin

The requirements for our app goes like this:

- Only allow c# boolean expressions to be entered ie. they evaluates to true/false

- Supply intellisense when Custom datatypes are entered in the Syntax Editor like "person.AgeInYears > 60" (when "person." is entered show all properties available on Person)

- Show meaningful messages when something is wrong in the c# boolean expression.

 

The custom data types will be supplied at runtime - since they can be created in another place in the application.

 

Any hints how to accomplish the above?

 

Thanks in advance ;-)

Regards Morten

Comments (1)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Morten,

Thank you for evaluating SyntaxEditor. Yes, you certainly can edit C# expressions with full IntelliPrompt support by using SyntaxEditor with our .NET Languages Add-on, and harnessing the code fragments feature.

If you look at our Code Fragments QuickStart in the latest version, that sample shows how to edit a number of C# statements (a method body). You'd do a similar thing but wrap your document with a header like:

Header (ensure it has a trailing line feed):

using System;
class EXpressionWrapper {
	private EXpressionWrapper() {
		Person person;
		return

Footer (ensure it has a starting line feed):

	;}
}

If you want to make variables available, all you have to do is define them in the header text like I show there with Person.

Syntax errors should show up properly then as well, with squiggle lines and quick info tips.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.