C# Класс AppKit.TextKit.Formatter.LanguageFormatter

Наследование: NSObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FindEndOfLine ( string text, NSRange position ) : NSRange

Finds the start of end for the given location in the text as defined by the NewLine, LineSeparator and ParagraphSeparator characters.

FindLineBoundries ( string text, NSRange position ) : NSRange

Finds the line boundries as defined by the NewLine, LineSeparator and ParagraphSeparator characters.

FindStartOfLine ( string text, NSRange position ) : NSRange

Finds the start of line for the given location in the text as defined by the NewLine, LineSeparator and ParagraphSeparator characters.

FindWordBoundries ( string text, NSRange position ) : NSRange

Finds the word boundries as defined by the LanguageSeparators in the AppKit.TextKit.Formatter.LanguageDescriptor that is currently being syntax highlighted.

HighlightSyntax ( string word, NSRange range ) : void

Uses the current Language (AppKit.TextKit.Formatter.LanguageDescriptor) to syntax highlight the given word in the attached TextEditor (NSTextView) at the given character locations.

TODO: The Text Kit SetTemporaryAttributes routines are handiling the format of character strings such as HTML or XML tag incorrectly.

HighlightSyntaxRegion ( string text, NSRange position ) : void

Based on the current Language (AppKit.TextKit.Formatter.LanguageDescriptor), highlight the syntax of the given character region.

IsLanguageSeparator ( char c ) : bool

Determines whether the passed in character is a language separator.

LanguageFormatter ( NSTextView textEditor, LanguageDescriptor language ) : System

Initializes a new instance of the AppKit.TextKit.Formatter.LanguageFormatter class.

PreceedingCharacterIsWhitespaceOrTerminator ( string text, NSRange position ) : bool

Tests to see if the preceeding character is whitespace or terminator.

Returns true if at start of line.

Reformat ( ) : void

Forces all of the text in the attached NSTextView (the TextEditor property) to have its syntax rehighlighted by re-running the formatter.

TrailingCharacterIsWhitespaceOrTerminator ( string text, NSRange position ) : bool

Tests to see if the trailing character is whitespace or terminator.

Returns true if at end of line.

Описание методов

FindEndOfLine() публичный Метод

Finds the start of end for the given location in the text as defined by the NewLine, LineSeparator and ParagraphSeparator characters.
public FindEndOfLine ( string text, NSRange position ) : NSRange
text string The text to find the end of the line in.
position NSRange The current location of the cursor in the text and possible selection.
Результат NSRange

FindLineBoundries() публичный Метод

Finds the line boundries as defined by the NewLine, LineSeparator and ParagraphSeparator characters.
public FindLineBoundries ( string text, NSRange position ) : NSRange
text string The string to be searched.
position NSRange The NSRange specifying the starting location of a possible /// line of text.
Результат NSRange

FindStartOfLine() публичный Метод

Finds the start of line for the given location in the text as defined by the NewLine, LineSeparator and ParagraphSeparator characters.
public FindStartOfLine ( string text, NSRange position ) : NSRange
text string The text to find the start of the line in.
position NSRange The current location of the cursor in the text and possible selection.
Результат NSRange

FindWordBoundries() публичный Метод

Finds the word boundries as defined by the LanguageSeparators in the AppKit.TextKit.Formatter.LanguageDescriptor that is currently being syntax highlighted.
public FindWordBoundries ( string text, NSRange position ) : NSRange
text string The string to be searched.
position NSRange The NSRange specifying the starting location of a possible word.
Результат NSRange

HighlightSyntax() публичный Метод

Uses the current Language (AppKit.TextKit.Formatter.LanguageDescriptor) to syntax highlight the given word in the attached TextEditor (NSTextView) at the given character locations.
TODO: The Text Kit SetTemporaryAttributes routines are handiling the format of character strings such as HTML or XML tag incorrectly.
public HighlightSyntax ( string word, NSRange range ) : void
word string The possible keyword to highlight.
range NSRange An NSRange specifying the starting and ending character locations /// for the word to highlight.
Результат void

HighlightSyntaxRegion() публичный Метод

Based on the current Language (AppKit.TextKit.Formatter.LanguageDescriptor), highlight the syntax of the given character region.
public HighlightSyntaxRegion ( string text, NSRange position ) : void
text string The string value to be syntax highlighted.
position NSRange The starting location of the text to be highlighted.
Результат void

IsLanguageSeparator() публичный Метод

Determines whether the passed in character is a language separator.
public IsLanguageSeparator ( char c ) : bool
c char The character being tested.
Результат bool

LanguageFormatter() публичный Метод

Initializes a new instance of the AppKit.TextKit.Formatter.LanguageFormatter class.
public LanguageFormatter ( NSTextView textEditor, LanguageDescriptor language ) : System
textEditor NSTextView The NSTextView that this language formatter will syntax highlight.
language LanguageDescriptor The defining the /// language syntax highlighting rules.
Результат System

PreceedingCharacterIsWhitespaceOrTerminator() публичный Метод

Tests to see if the preceeding character is whitespace or terminator.
Returns true if at start of line.
public PreceedingCharacterIsWhitespaceOrTerminator ( string text, NSRange position ) : bool
text string The text to test.
position NSRange The current cursor position inside the text.
Результат bool

Reformat() публичный Метод

Forces all of the text in the attached NSTextView (the TextEditor property) to have its syntax rehighlighted by re-running the formatter.
public Reformat ( ) : void
Результат void

TrailingCharacterIsWhitespaceOrTerminator() публичный Метод

Tests to see if the trailing character is whitespace or terminator.
Returns true if at end of line.
public TrailingCharacterIsWhitespaceOrTerminator ( string text, NSRange position ) : bool
text string The text to test.
position NSRange The current cursor position inside the text.
Результат bool