Class ConfigLexem
Represents a class that provides the configuration that has to be parsed in some defined way.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Edit.Implementation.Config
Assembly: Syncfusion.Edit.Windows.dll
Syntax
public class ConfigLexem : ICollapsableConfigLexem, IConfigLexem, IComparable
Constructors
ConfigLexem()
Initializes a new instance of the ConfigLexem class.
Declaration
public ConfigLexem()
ConfigLexem(String, String, FormatType, Boolean)
Initializes a new instance of the ConfigLexem based on begin, end, format.
Declaration
public ConfigLexem(string begin, string end, FormatType format, bool isComplex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | begin | Begin of lexem configuration. |
| System.String | end | End of lexem configuration. |
| FormatType | format | Format of the lexem configuration. |
| System.Boolean | isComplex | indicates whether lexem should be complex. |
Properties
AllowTriggers
Gets or sets a value indicating whether autoreplace triggers can be used.
Declaration
public bool AllowTriggers { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AutoNameExpression
Gets or sets expression for auto-naming.
Declaration
public string AutoNameExpression { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
When parsing collapsed region, parser reads text from stream until text matches given expression. You can specify different named groups here to use them later in AutoNameTemplate.
AutoNameRegex
Gets regular expression instance for AutoNameExpression.
Declaration
public Regex AutoNameRegex { get; }
Property Value
| Type |
|---|
| System.Text.RegularExpressions.Regex |
AutoNameTemplate
Gets or sets template of resulting text for auto-naming of collapse.
Declaration
public string AutoNameTemplate { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
To specify "$" symbol you must use $$. To use result of some named group, use ${name}.
BeginBlock
Gets or sets begin symbol or word for lexem.
Declaration
public string BeginBlock { get; set; }
Property Value
| Type |
|---|
| System.String |
CollapseName
Gets or sets name of the collapsed region.
Declaration
public string CollapseName { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
If IsCollapseAutoNamed is true, then this property's value will be used only when found name is empty.
Condition
Gets or sets condition needed to pass check. Format: name=ON|OFF.
Declaration
public string Condition { get; set; }
Property Value
| Type |
|---|
| System.String |
ContentDivider
Gets or sets a value indicating whether the content divider should be shown below lexem.
Declaration
public bool ContentDivider { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ContinueBlock
If lexem can be divided into several lines or has some special rules which can continue lexem then use this setting.
Declaration
public string ContinueBlock { get; set; }
Property Value
| Type |
|---|
| System.String |
DefaultInGroup
Gets value indicating whether lexem should be used if there are more than one config found on one priority level.
Declaration
public bool DefaultInGroup { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
DropContextChoiceList
Gets or sets a value indicating whether the dropping down context choice list after entering text of the current lexem.
Declaration
public bool DropContextChoiceList { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Can be set only on non-complex lexems.
DropContextPrompt
Gets or sets a value indicating whether the context prompt should be shown after typing text of the current lexem.
Declaration
public bool DropContextPrompt { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Can be set only on non-complex lexems.
EndBlock
Gets or sets end symbol or word for lexem. If lexem is "keyword" then this property must be set to null value.
Declaration
public string EndBlock { get; set; }
Property Value
| Type |
|---|
| System.String |
Format
Gets or sets the format based on its Type and FormatName.
Declaration
public ISnippetFormat Format { get; }
Property Value
| Type |
|---|
| ISnippetFormat |
FormatCollapse
Gets the format that are used for drawing lexems in collapsed state.
Declaration
public ISnippetFormat FormatCollapse { get; }
Property Value
| Type |
|---|
| ISnippetFormat |
FormatName
Gets or sets FormatName which must be used for coloring.
Declaration
public string FormatName { get; set; }
Property Value
| Type |
|---|
| System.String |
ID
Gets or sets static unique ID of configuration node.
Declaration
public int ID { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Indent
Gets or sets sign of auto-indenting after lexem with such config.
Declaration
public bool Indent { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IndentationGuideline
Gets or sets value indicating whether IndentationGuideline should be shown.
Declaration
public bool IndentationGuideline { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsBeginRegex
Gets or sets a value indicating whether the BeginBlock property contains regular expression or not.
Declaration
public bool IsBeginRegex { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsCollapsable
Gets or sets a value indicating whether the lexem can be collapsed or not.
Declaration
public bool IsCollapsable { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsCollapseAutoNamed
Gets a value indicating whether name of the collapsed region lexem should read by itself.
Declaration
public bool IsCollapseAutoNamed { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
If this property is false, CollapseName will be used to name the region.
Note: you should know that if this property is true, then on by-lexem reading you'll have to wait while sub-lexems will be loaded, then processed by RegEx, and only then you'll have your collapsible lexem.
IsComplex
Gets or sets a value indicating whether parser parses lexem internals or not. In complex constructions data between begin and end blocks can have own formats.
Declaration
public bool IsComplex { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsContinueRegex
Gets or sets a value indicating whether the ContinueBlock property contains regular expression or not.
Declaration
public bool IsContinueRegex { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsEndRegex
Gets or sets a value indicating whether the EndBlock property contains regular expression or not.
Declaration
public bool IsEndRegex { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsPseudoEnd
Gets or sets sign indicating whether the end-block is just the way to exit higher by stack, or it is real ending of lexem.
Declaration
public bool IsPseudoEnd { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Language
Language lexem belongs to.
Declaration
public IConfigLanguage Language { get; }
Property Value
| Type |
|---|
| IConfigLanguage |
NextID
Gets or sets ID of the lexem configuration, that follows right after current one is parsed. Such lexem must be complex and "OnlyLocalSublexems", without beginblock and with endblock.
Declaration
public int NextID { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
NextLexem
Gets resolved next-lexem.
Declaration
public IConfigLexem NextLexem { get; }
Property Value
| Type |
|---|
| IConfigLexem |
OnlyLocalSublexems
Gets or sets a value indicating whether parser should look for lexems configuration just in local array or also look in parents.
Declaration
public bool OnlyLocalSublexems { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ParentConfig
Gets or sets the parent configuration.
Declaration
public IConfigLexem ParentConfig { get; set; }
Property Value
| Type |
|---|
| IConfigLexem |
Priority
If many lexems have the same begin string then parser must control the order in which to interpret input as lexem.
Declaration
public int Priority { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
References
Gets or sets list of references. If config was not found in sub lexems, then search is done in this list.
Declaration
public ArrayList References { get; set; }
Property Value
| Type |
|---|
| System.Collections.ArrayList |
SubLexems
Gets or sets the sublexems that must be skipped if they are found after BeginBlock string before EndBlock string.
Declaration
public ArrayList SubLexems { get; set; }
Property Value
| Type |
|---|
| System.Collections.ArrayList |
Type
Gets or sets format which must be used for coloring. If format is Custom then use the FormatName property for format identification.
Declaration
public FormatType Type { get; set; }
Property Value
| Type |
|---|
| FormatType |
TypeCollapsed
Gets or sets name of the format to be used in collapsed state.
Declaration
public string TypeCollapsed { get; set; }
Property Value
| Type |
|---|
| System.String |
TypeXML
Gets or sets the format which must be used for coloring. If format is Custom, then used FormatName property for format identification.
Declaration
public string TypeXML { get; set; }
Property Value
| Type |
|---|
| System.String |
UseCustomControl
Gets or sets value indicating if custom control should be used instead of the simple lexem rendering.
Declaration
public bool UseCustomControl { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
VirtualConfig
Gets the virtual config for current lexem.
Declaration
public IConfigLexem VirtualConfig { get; }
Property Value
| Type |
|---|
| IConfigLexem |
Remarks
Virtual configs does not support collapsed state.
Methods
CompareTo(Object)
Compares this instance with a specified System.Object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified System.Object.
Declaration
public int CompareTo(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | An object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| System.Int32 | A 32-bit signed integer that indicates the relative order of the objects being compared. |
DropFormats()
Drops cached links to formats.
Declaration
public void DropFormats()
FindConfigs(String)
Searches for configs in sub-lexems. Current lexem config is not tested for equalization. If config was not found in sub-lexems, it will be searched in parent.
Declaration
public IList FindConfigs(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | String to find. |
Returns
| Type | Description |
|---|---|
| System.Collections.IList | List of config lexems. |
GetFormatManager()
Searches up the parent that supports IFormatManager interface.
Declaration
protected IFormatManager GetFormatManager()
Returns
| Type | Description |
|---|---|
| IFormatManager | Format manager. |
IsEqualToBegin(String)
Checks whether the specified string is equal to the begin block. If begin block is regular expression, input string will be checked by regular expressions.
Declaration
public bool IsEqualToBegin(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | String to be checked |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it can be treated as begin block. |
IsEqualToContinue(String)
Checks whether the specified string is equal to continue block. If continue block is regular expression, input string will be checked by regular expression.
Declaration
public bool IsEqualToContinue(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | String to be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it can be treated as continue block. |
IsEqualToEnd(String)
Checks whether the specified string is equal to end block.If end block is regular expression, input string will be checked by regular expression.
Declaration
public bool IsEqualToEnd(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | String to be checked. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it can be treated as end block. |
OnBeginBlockChanged(ValueChangedEventArgs)
Calls raiser for BeginBlock.
Declaration
protected virtual void OnBeginBlockChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnContinueBlockChanged(ValueChangedEventArgs)
Calls raiser for ContinueBlock.
Declaration
protected virtual void OnContinueBlockChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnEndBlockChanged(ValueChangedEventArgs)
Calls raiser for EndBlock.
Declaration
protected virtual void OnEndBlockChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnFormatNameChanged(ValueChangedEventArgs)
Calls raiser for FormatName.
Declaration
protected virtual void OnFormatNameChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnIsBeginRegexChanged(ValueChangedEventArgs)
Calls raiser for IsBeginRegex.
Declaration
protected virtual void OnIsBeginRegexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnIsCollapsableChanged(ValueChangedEventArgs)
Calls raiser for IsCollapsable.
Declaration
protected virtual void OnIsCollapsableChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnIsComplexChanged(ValueChangedEventArgs)
Calls raiser for IsComplex.
Declaration
protected virtual void OnIsComplexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnIsContinueRegexChanged(ValueChangedEventArgs)
Calls raiser for IsContinueRegex.
Declaration
protected virtual void OnIsContinueRegexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnIsEndRegexChanged(ValueChangedEventArgs)
Calls raiser for IsEndRegex.
Declaration
protected virtual void OnIsEndRegexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnOnlyLocalSublexemsChanged(ValueChangedEventArgs)
Calls raiser for OnlyLocalSublexems.
Declaration
protected virtual void OnOnlyLocalSublexemsChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnPriorityChanged(ValueChangedEventArgs)
Calls raiser for Priority.
Declaration
protected virtual void OnPriorityChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnSubLexemsChanged(ValueChangedEventArgs)
Calls raiser for SubLexems.
Declaration
protected virtual void OnSubLexemsChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
OnTypeChanged(ValueChangedEventArgs)
Calls raiser for Type.
Declaration
protected virtual void OnTypeChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseBeginBlockChanged(ValueChangedEventArgs)
Raises property changed event for BeginBlock.
Declaration
protected void RaiseBeginBlockChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseContinueBlockChanged(ValueChangedEventArgs)
Raises property changed event for ContinueBlock.
Declaration
protected void RaiseContinueBlockChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseEndBlockChanged(ValueChangedEventArgs)
Raises property changed event for EndBlock.
Declaration
protected void RaiseEndBlockChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseFormatNameChanged(ValueChangedEventArgs)
Raises property changed event for FormatName.
Declaration
protected void RaiseFormatNameChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseIsBeginRegexChanged(ValueChangedEventArgs)
Raises property changed event for IsBeginRegex.
Declaration
protected void RaiseIsBeginRegexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseIsCollapsableChanged(ValueChangedEventArgs)
Raises property changed event for IsCollapsable.
Declaration
protected void RaiseIsCollapsableChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseIsComplexChanged(ValueChangedEventArgs)
Raises property changed event for IsComplex.
Declaration
protected void RaiseIsComplexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseIsContinueRegexChanged(ValueChangedEventArgs)
Raises property changed event for IsContinue.
Declaration
protected void RaiseIsContinueRegexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseIsEndRegexChanged(ValueChangedEventArgs)
Raises property changed event for IsEndRegex.
Declaration
protected void RaiseIsEndRegexChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseOnlyLocalSublexemsChanged(ValueChangedEventArgs)
Raises property changed event for OnlyLocalSublexems.
Declaration
protected void RaiseOnlyLocalSublexemsChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaisePriorityChanged(ValueChangedEventArgs)
Raises property changed event for Priority.
Declaration
protected void RaisePriorityChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseSubLexemsChanged(ValueChangedEventArgs)
Raises property changed event for SubLexems.
Declaration
protected void RaiseSubLexemsChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
RaiseTypeChanged(ValueChangedEventArgs)
Raises property changed event for Type.
Declaration
protected void RaiseTypeChanged(ValueChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueChangedEventArgs | args | ValueChangedEventArgs |
ReplaceNewLine(String)
Replaces all newline symbols in regex to the unified pattern.
Declaration
public static string ReplaceNewLine(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | Regular expression. |
Returns
| Type | Description |
|---|---|
| System.String | String with changes. |
ResetID()
Resets ID property value.
Declaration
public void ResetID()
ShouldSerializeID()
Determines whether ID property value should be serialized.
Declaration
public bool ShouldSerializeID()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if ID property value should be serialized. |
ShouldSerializeSubLexems()
Determines whether SubLexems has been modified and its contents should be serialized at design-time.
Declaration
public bool ShouldSerializeSubLexems()
Returns
| Type |
|---|
| System.Boolean |
ToString()
Gets description of the configuration.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | �escription of the configuration. |
Overrides
UpdateSublexems()
Updates ParentConfig property of all sublexems.
Declaration
public void UpdateSublexems()
Events
BeginBlockChanged
Occurs after BeginBlock has changed.
Declaration
public event EventHandler BeginBlockChanged
Event Type
| Type |
|---|
| System.EventHandler |
ContinueBlockChanged
Occurs after ContinueBlock has changed.
Declaration
public event EventHandler ContinueBlockChanged
Event Type
| Type |
|---|
| System.EventHandler |
EndBlockChanged
Occurs after EndBlock has changed.
Declaration
public event EventHandler EndBlockChanged
Event Type
| Type |
|---|
| System.EventHandler |
FormatNameChanged
Occurs after FormatName has changed.
Declaration
public event EventHandler FormatNameChanged
Event Type
| Type |
|---|
| System.EventHandler |
IsBeginRegexChanged
Occurs after IsBeginRegex has changed.
Declaration
public event EventHandler IsBeginRegexChanged
Event Type
| Type |
|---|
| System.EventHandler |
IsCollapsableChanged
Occurs after IsCollapsable has changed.
Declaration
public event EventHandler IsCollapsableChanged
Event Type
| Type |
|---|
| System.EventHandler |
IsComplexChanged
Occurs after IsComplex has changed.
Declaration
public event EventHandler IsComplexChanged
Event Type
| Type |
|---|
| System.EventHandler |
IsContinueRegexChanged
Occurs after IsContinueRegex has changed.
Declaration
public event EventHandler IsContinueRegexChanged
Event Type
| Type |
|---|
| System.EventHandler |
IsEndRegexChanged
Occurs after IsEndRegex has changed.
Declaration
public event EventHandler IsEndRegexChanged
Event Type
| Type |
|---|
| System.EventHandler |
OnlyLocalSublexemsChanged
Occurs after OnlyLocalSublexems has changed.
Declaration
public event EventHandler OnlyLocalSublexemsChanged
Event Type
| Type |
|---|
| System.EventHandler |
PriorityChanged
Occurs after BeginBlock has changed.
Declaration
public event EventHandler PriorityChanged
Event Type
| Type |
|---|
| System.EventHandler |
SubLexemsChanged
Occurs after SubLexems has changed.
Declaration
public event EventHandler SubLexemsChanged
Event Type
| Type |
|---|
| System.EventHandler |
TypeChanged
Occurs after Type has changed.
Declaration
public event EventHandler TypeChanged
Event Type
| Type |
|---|
| System.EventHandler |