We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

access to lexems in a collapsed region

Thread ID:

Created:

Updated:

Platform:

Replies:

54968 Jan 20,2007 06:55 PM UTC Mar 7,2007 04:15 PM UTC Windows Forms 4
loading
Tags: EditControl
Administrator [Syncfusion]
Asked On January 20, 2007 06:55 PM UTC

When a certain key is pressed in the editor, I use the EditControl's GetLine method to scan all lines above the current line picking out particular lexems of interest for a context choice prompt.

This technique works well except when there is a collapsed region somewhere above the current line. The line with the collapsed region has a special lexem that appears to represent the collapsed region. The lexem's Collapser property is non-null but doesn't appear to have any way to get to the lexems inside of the region.

Is there a way to gain access to the lexems inside of a collapsed region without first expanding it?

thanks,
Travis

Administrator [Syncfusion]
Replied On January 23, 2007 12:19 AM UTC

Hi Travis,

It is possible to access the lexems inside a collapsed region.I have attached a sample that illustrates this. Let me know if this meets your requirements.

Thanks for your patience.

Regards,
Ebenezer.P

sample

Administrator [Syncfusion]
Replied On January 28, 2007 03:33 PM UTC

Thanks Ebenezer. To sum up your sample, the way to get access to lexems in collapsed regions is to create a secondary EditControl set with the .Text of the original control. This secondary control has all regions expanded by default and therefore has access to all lexems. The downside is the potential performance hit in parsing the complete text a second time just to get access to a few collapsed regions. Kind of a hack but works for me for now.

-travis

Administrator [Syncfusion]
Replied On March 7, 2007 12:30 AM UTC

Hi Ebenezer,

I'm using the hidden edit control technique you described previously. It has largely worked for me but now I notice that with a certain data file it crashes on the second use of the technique for some reason. The crash is on this line:

expandedEditor.Text = editor.Text;

Attached is the stack trace.

Any ideas?



stack-trace.zip

Administrator [Syncfusion]
Replied On March 7, 2007 04:15 PM UTC

Hi Travis,

I have tested for this issue using version 4.4.0.51 and was not able to see the problem. This is how I went about testing this issue :

1.Run the attached sample.

2.Click Lexems several times.

3.Exception is not thrown.

Please let me know if I am missing something. Also, Could you please let me know the version of Essential Studio being used by you.

Thanks for your patience.

Regards,
Ebenezer.P

sample

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;