logo

Highlight class, provides highlighting of a richedittextbox. More...

Static Public Member Functions

static void DeinitHighlighter ()
 Clear the keywords list. More...
 
static void InitHighlighter ()
 Initializes TextHighlighter fill the keywords lists. More...
 
static void CheckSyntaxFull (RichTextBox rtb, int skinnr, Notes notes)
 Check the syntax of alle set languages on the RichTextbox RTF content. More...
 
static void CheckSyntaxQuick (RichTextBox rtb, int skinnr, Notes notes)
 Do a quick syntax check of the last added part of text. More...
 

Properties

static bool KeywordsInitialized [get]
 Gets a value indicating whether highlighting keywords are initialized. More...
 

Static Private Member Functions

static string CheckSyntaxPart (RichTextBox rtb, string rtf, string part, int curpos, int lastpos)
 Check the syntax of a part of the text with the enabled languages. More...
 
static string ColorText (RichTextBox rtb, string rtf, int posstart, int len, string hexcolor)
 Color some part of the rich edit text. More...
 
static string ResetHighlighting (RichTextBox rtb, string rtf, int skinnr, Notes notes)
 Make the whole text the default font color. More...
 
static string ValidatingHtmlPart (string ishtml, RichTextBox rtb, string rtf, int posstartpart, HighlightLanguage langhtml)
 Highlight some text part on html split by spaces. More...
 
static string ValidateHTMLAttribute (string htmlattribute, RichTextBox rtb, string rtf, int attributestartpos, HighlightLanguage langhtml)
 Validate HTML attribute More...
 
static string ValidatingPhpPart (string isphp, RichTextBox rtb, string rtf, int posstart, HighlightLanguage langphp)
 Find out if it is a php keyword. More...
 
static string ValidatingSqlPart (string issql, RichTextBox rtb, string rtf, int posstart, HighlightLanguage langsql)
 Find out if it is a sql keyword. More...
 

Private Attributes

const string LANGFILE = "langs.xml"
 The filename with xml description of languages keywords / lexicon More...
 

Static Private Attributes

static List< HighlightLanguagelangs
 List with languages description how to highlight them. More...
 
static bool comment = false
 Is the highlighter in a comment part. More...
 
static bool commentline = false
 Is the highlighter on a comment line. More...
 
static bool outerhtml = true
 Is the highlighter outside of a HTML part in mixed document. More...
 
static bool htmlstringpart = false
 Is ths highlighter on a HTML string part. More...
 
static bool phpstringpart = false
 Is the highlighter on a PHP string part. More...
 
static bool sqlfieldopen = false
 Are we in a sql field. More...
 
static char currentstringquote = '"'
 What is the character (usually quote) used to start the string part with. More...
 
static bool keywordsinit = false
 Are keyword initilized More...
 
static RTFDirectEdit rtfdirectedit
 Reference to RTFDirectEdit class for directly editing RTF used for coloring in the RichTextBox. More...
 

Detailed Description

Member Function Documentation

static void NoteFly.SyntaxHighlight.CheckSyntaxFull ( RichTextBox  rtb,
int  skinnr,
Notes  notes 
)
static
Parameters
rtbThe richttextbox with RTF note content.
skinnrThe skin number
notesPointer to notes class.
static string NoteFly.SyntaxHighlight.CheckSyntaxPart ( RichTextBox  rtb,
string  rtf,
string  part,
int  curpos,
int  lastpos 
)
staticprivate
Parameters
rtbThe RichTextBox control.
rtfThe RTF text
partThe space seperated part of text to check.
curposThe current position in the text.
lastposThe position of where the part started in the text of the RichTextBox.
Returns
The new RTF text syntax highlighted.
static void NoteFly.SyntaxHighlight.CheckSyntaxQuick ( RichTextBox  rtb,
int  skinnr,
Notes  notes 
)
static
Parameters
rtbRichEditTextbox
skinnrThe skinnr
notesReference to notes
static string NoteFly.SyntaxHighlight.ColorText ( RichTextBox  rtb,
string  rtf,
int  posstart,
int  len,
string  hexcolor 
)
staticprivate
Parameters
rtbThe richtextbox contain the rtf text to apply coloring on.
rtfThe RTF text
posstartThe start position in the text to start coloring from.
lenThe lenght of text to color.
hexcolorThe color the text should get.
Returns
The new RTF content of the note.
static void NoteFly.SyntaxHighlight.DeinitHighlighter ( )
static
static void NoteFly.SyntaxHighlight.InitHighlighter ( )
static
static string NoteFly.SyntaxHighlight.ResetHighlighting ( RichTextBox  rtb,
string  rtf,
int  skinnr,
Notes  notes 
)
staticprivate
Parameters
rtbThe richedit control that hold the note content.
rtfThe RTF text
skinnrThe skin number of the current note.
notesReference to notes class.
Returns
The new rtf stream
static string NoteFly.SyntaxHighlight.ValidateHTMLAttribute ( string  htmlattribute,
RichTextBox  rtb,
string  rtf,
int  attributestartpos,
HighlightLanguage  langhtml 
)
staticprivate
Parameters
htmlattributeAttribute of the HTML node to validate
rtbRichtextbox with note content
rtfThe rtf stream.
attributestartposStartposition of the attribute within the htmlpart.
langhtmlThe html language description.
Returns
The new rtf stream
static string NoteFly.SyntaxHighlight.ValidatingHtmlPart ( string  ishtml,
RichTextBox  rtb,
string  rtf,
int  posstartpart,
HighlightLanguage  langhtml 
)
staticprivate
Parameters
ishtmlString without spaces. length needs to be >0
rtbThe richtextbox.
rtfThe rtf stream.
posstartpartThe start position in the richtextbox.
langhtmlThe html language description.
Returns
The new rtf stream
static string NoteFly.SyntaxHighlight.ValidatingPhpPart ( string  isphp,
RichTextBox  rtb,
string  rtf,
int  posstart,
HighlightLanguage  langphp 
)
staticprivate
Parameters
isphpA part to be check if this a php keyword.
rtbThe richtextbox.
rtfThe rtf stream.
posstartThe position in rtb where this keyword starts.
langphpThe PHP language description.
Returns
The new rtf stream.
static string NoteFly.SyntaxHighlight.ValidatingSqlPart ( string  issql,
RichTextBox  rtb,
string  rtf,
int  posstart,
HighlightLanguage  langsql 
)
staticprivate
Parameters
issqlThe part to be check.
rtbThe richtextbox.
rtfThe rtf stream.
posstartPosition where the keyword starts in the richtextbox.
langsqlThe sql language description.
Returns
The new rtf stream.

Member Data Documentation

bool NoteFly.SyntaxHighlight.comment = false
staticprivate
bool NoteFly.SyntaxHighlight.commentline = false
staticprivate
char NoteFly.SyntaxHighlight.currentstringquote = '"'
staticprivate
bool NoteFly.SyntaxHighlight.htmlstringpart = false
staticprivate
bool NoteFly.SyntaxHighlight.keywordsinit = false
staticprivate
const string NoteFly.SyntaxHighlight.LANGFILE = "langs.xml"
private
List<HighlightLanguage> NoteFly.SyntaxHighlight.langs
staticprivate
bool NoteFly.SyntaxHighlight.outerhtml = true
staticprivate
bool NoteFly.SyntaxHighlight.phpstringpart = false
staticprivate
RTFDirectEdit NoteFly.SyntaxHighlight.rtfdirectedit
staticprivate
bool NoteFly.SyntaxHighlight.sqlfieldopen = false
staticprivate

Property Documentation

bool NoteFly.SyntaxHighlight.KeywordsInitialized
staticget