C# Class AppKit.TextKit.Formatter.LanguageFormatter

Inheritance: NSObject
Afficher le fichier Open project: xamarin/mac-samples Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

FindEndOfLine() public méthode

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.
Résultat NSRange

FindLineBoundries() public méthode

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.
Résultat NSRange

FindStartOfLine() public méthode

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.
Résultat NSRange

FindWordBoundries() public méthode

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.
Résultat NSRange

HighlightSyntax() public méthode

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.
Résultat void

HighlightSyntaxRegion() public méthode

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.
Résultat void

IsLanguageSeparator() public méthode

Determines whether the passed in character is a language separator.
public IsLanguageSeparator ( char c ) : bool
c char The character being tested.
Résultat bool

LanguageFormatter() public méthode

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.
Résultat System

PreceedingCharacterIsWhitespaceOrTerminator() public méthode

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.
Résultat bool

Reformat() public méthode

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
Résultat void

TrailingCharacterIsWhitespaceOrTerminator() public méthode

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.
Résultat bool