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.

Building a config programatically (version 3)

Thread ID:

Created:

Updated:

Platform:

Replies:

25880 Mar 9,2005 02:04 AM Mar 9,2005 02:17 AM Windows Forms 1
loading
Tags: EditControl
Leon Jones
Asked On March 9, 2005 02:04 AM

Hi, I need to build my language programatically and am having problems associating the Format with my new Lexem. I am adding my format via ConfigLanguage.Add Setting my lexem type to Custom and setting my lexem formatName to the name of my format. At runtime I get the null reference exception in a call to ConfigLexem.get_Format(); I cannot set the format directly as the Format property is read-only. Please can you send me a simple code fragment to demonstrate how to do this as I am unable to find anything in your documentation (the sample app hides the model creation away). Thanks in advance. Leon

Leon Jones
Replied On March 9, 2005 02:17 AM

This is the code and stack trace: Format myFormat = new Format("MyFormat", Color.Green, Color.Yellow, Color.Aqua, new Font("Tahoma", 8)); language.Add(myFormat); ConfigLexem myLexem = new ConfigLexem("~", "", FormatType.Custom, false); myLexem.FormatName = myFormat.Name; language.Lexems.Add(myLexem); ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Edit.Implementation.Config.ConfigLexem.get_Format() at Syncfusion.Windows.Forms.Edit.Implementation.Parser.RenderedLine.Measure(Single maxSize) at Syncfusion.Windows.Forms.Edit.Implementation.Parser.RenderableLexemParser.GraphicalToVirtual(Point point) at Syncfusion.Windows.Forms.Edit.StreamEditControl.UpdateToolTip(Object sender, UpdateTooltipEventArgs e) at Syncfusion.Windows.Forms.Edit.Dialogs.ToolTipEx.m_timer_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)

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.

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.

;