Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146563 | Aug 8,2019 09:48 AM UTC | Aug 9,2019 02:12 PM UTC | WinForms | 1 |
![]() |
Tags: EditControl |
// Creates new file using C# language configuration.
editControl1.NewFile(editControl1.Configurator["C#"]);
// Creates format for methods coloring.
ISnippetFormat formatMethod = editControl1.Language.Add("Method", "Text");
formatMethod.FontColor = Color.HotPink;
// Creates format for properties coloring.
ISnippetFormat formatProperty = editControl1.Language.Add("Property", "Text");
formatProperty.FontColor = Color.Goldenrod;
// Disables ContextChoiceList dropping after dot in global context.
ConfigLexem lexemDot_ = GetConfigLexem((IConfigLexem)editControl1.Language, ".");
lexemDot_.DropContextChoiceList = false;
// Add configuration for "Property1"
ConfigLexem this_Property1 = GetConfigLexem((IConfigLexem)editControl1.Language, "var1");
this_Property1.Type = FormatType.Custom; this_Property1.FormatName = "Property";
this_Property1.IsComplex = true;
// Add configuration for "." after "Property1"
ConfigLexem propertyDot = GetConfigLexem((IConfigLexem)this_Property1, ".");
propertyDot.Type = FormatType.Operator;
propertyDot.DropContextChoiceList = true;
propertyDot.IsComplex = true;
propertyDot.Priority = 10;
// Add "Method1" configuration after "this.Property1."
ConfigLexem property_Method1 = GetConfigLexem((IConfigLexem)propertyDot, "MethodA");
property_Method1.Type = FormatType.Custom; property_Method1.FormatName = "Method";
property_Method1.IsComplex = true;
// Add "Method2" configuration after "this.Property1."
ConfigLexem property_Method2 = GetConfigLexem((IConfigLexem)propertyDot, "MethodB");
property_Method2.Type = FormatType.Custom; property_Method2.FormatName = "Method";
property_Method2.IsComplex = true;
editControl1.Language.ResetCaches();
m_MethodComments[this_Property1.ID] = "The only one property\nIt has multiline description";
m_MethodComments[property_Method1.ID] = "Method 1";
m_MethodComments[property_Method2.ID] = "Method 2"; |
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.
This page will automatically be redirected to the sign-in page in 10 seconds.