logo
NoteFly.HighlightLanguage Class Reference

HighlightLanguage class, a data class that holds lexicon of a language to highlight. More...

Public Member Functions

 HighlightLanguage (string name, string commentline, string commentstart, string commentend, string docstartstr, string docendstr, string[] keywords)
 Initializes a new instance of the HighlightLanguage class. More...
 
bool FindKeyword (string keyword)
 Lookup if keyword exists. (use fast dicnary lookup) More...
 
void CheckSetDocumentPos (string keyword, int curpos)
 Check if keyword is used to set document end or start and then set length of document. More...
 

Properties

string Name [get]
 Gets the name of the language More...
 
string Commentline [get]
 Gets the comment line characters More...
 
string Commentstart [get]
 Gets the comment start characters More...
 
string Commentend [get]
 Gets the comment end characters More...
 
int NumKeywords [get]
 Gets the number of keywords. More...
 
string DocumentStartStr [get]
 Gets the characters that tell where the document starts. More...
 
string DocumentEndStr [get]
 Gets the characters that tell where the document ends. More...
 
int PosDocumentStart [get, set]
 Gets or sets the position where the document starts More...
 
int PosDocumentEnd [get, set]
 Gets or sets the position where the document ends More...
 

Private Attributes

string name
 The name of the language More...
 
string commentline
 The characters to make it a line comment. More...
 
string commentstart
 The characters to start commenting of multiple lines More...
 
string commentend
 The characters to end comment of multiple lines More...
 
string docstartstr
 The characters that tell where start of the document is. More...
 
string docendstr
 The characters that tell where the documents end. More...
 
int posdocstart = int.MaxValue
 The position where the document starts. More...
 
int posdocend = int.MaxValue
 The position where the documents ends. More...
 
Dictionary< string, int > keywordsdic
 Dictornary with all keywords used in this language More...
 

Detailed Description

Constructor & Destructor Documentation

NoteFly.HighlightLanguage.HighlightLanguage ( string  name,
string  commentline,
string  commentstart,
string  commentend,
string  docstartstr,
string  docendstr,
string[]  keywords 
)
Parameters
nameThe name of the language
commentlineHow a comment line is marked in this language
commentstartHow comments start is marked in this language
commentendHow comments end is marked in this language
docstartstrHow the document of this language start
docendstrHow the document of this language end
keywordsThe keywords to highlight on

Member Function Documentation

void NoteFly.HighlightLanguage.CheckSetDocumentPos ( string  keyword,
int  curpos 
)
Parameters
keywordThe keyword to check if the is used by this language as document start or end.
curposThe position in the richtextbox of the keyword.
bool NoteFly.HighlightLanguage.FindKeyword ( string  keyword)
Parameters
keywordThe keyword to lookup
Returns
True if exist in this highlightlanguage

Member Data Documentation

string NoteFly.HighlightLanguage.commentend
private
string NoteFly.HighlightLanguage.commentline
private
string NoteFly.HighlightLanguage.commentstart
private
string NoteFly.HighlightLanguage.docendstr
private
string NoteFly.HighlightLanguage.docstartstr
private
Dictionary<string, int> NoteFly.HighlightLanguage.keywordsdic
private
string NoteFly.HighlightLanguage.name
private
int NoteFly.HighlightLanguage.posdocend = int.MaxValue
private
int NoteFly.HighlightLanguage.posdocstart = int.MaxValue
private

Property Documentation

string NoteFly.HighlightLanguage.Commentend
get
string NoteFly.HighlightLanguage.Commentline
get
string NoteFly.HighlightLanguage.Commentstart
get
string NoteFly.HighlightLanguage.DocumentEndStr
get
string NoteFly.HighlightLanguage.DocumentStartStr
get
string NoteFly.HighlightLanguage.Name
get
int NoteFly.HighlightLanguage.NumKeywords
get
int NoteFly.HighlightLanguage.PosDocumentEnd
getset
int NoteFly.HighlightLanguage.PosDocumentStart
getset