C# Class Alsing.SourceCode.SyntaxDocument

The SyntaxDocument is a component that is responsible for Parsing , Folding , Undo / Redo actions and various text actions.
Inheritance: System.ComponentModel.Component, IEnumerable
Afficher le fichier Open project: vchelaru/FlatRedBall Class Usage Examples

Méthodes publiques

Свойство Type Description
KeywordQueue RowList
NeedResetRows bool
ParseQueue RowList
Parser IParser
Tag object
UndoBuffer UndoBuffer
VisibleRows RowList

Private Properties

Свойство Type Description
Init void
InitializeComponent void
InternalResetVisibleRows void
OnChange void
OnModifiedChanged void
OnRowDeleted void
OnRowParsed void
ParseRows int
ParseRows int

Méthodes publiques

Méthode Description
Add ( string text ) : Row

Add a new row with the specified text to the bottom of the document

Add ( string text, bool StoreUndo ) : Row

Add a new row with the specified text to the bottom of the document

AddToUndoList ( UndoBlock undo ) : void
AddToUndoList ( UndoBlockCollection ActionGroup ) : void

Add an action to the undo stack

AutoIndentSegment ( Span span ) : void
ChangeVersion ( ) : void

For internal use only

Clear ( ) : void
ClearBookmarks ( ) : void

Removes all bookmarks in the document

ClearBreakpoints ( ) : void

Removes all breakpoints in the document.

DeleteRange ( TextRange Range ) : void

Deletes a range of text

DeleteRange ( TextRange Range, bool StoreUndo ) : void

Deletes a range of text

EndUndoCapture ( ) : UndoBlockCollection

Ends an Undo capture and pushes the collected actions onto the undostack StartUndoCapture

EnsureParsed ( Row Row ) : void

Call this method to ensure that a specific row is fully parsed

FoldAll ( ) : void

Folds all foldable rows

GetEndBracketWord ( Word Start, Pattern End, Span FindIn ) : Word
GetEnumerator ( ) : IEnumerator

GetFormatWordFromPos ( TextPoint p ) : Word

Gets a Word object form a given column , Row index (this only applies if the row is fully parsed)

GetNextBookmark ( int StartIndex ) : int

Gets the row index of the next bookmarked row

GetPreviousBookmark ( int StartIndex ) : int

Gets the row index of the previous bookmarked row

GetRange ( TextRange Range ) : string

Get a range of text

GetRangeFromText ( string text, int xPos, int yPos ) : TextRange

Gets a Range from a given text

GetSegmentFromPos ( TextPoint p ) : Span

Gets a span object form a given column , Row index (This only applies if the row is fully parsed)

GetStartBracketWord ( Word Start, Pattern End, Span FindIn ) : Word
GetWordFromPos ( TextPoint p ) : Word

Gets a Word object form a given column , Row index (this only applies if the row is fully parsed)

IndexOf ( Row xtr ) : int

Returns the index of a given row

Insert ( string text, int index ) : Row

Insert a text at the specified row index

Insert ( string text, int index, bool storeUndo ) : Row

Insert a text at the specified row index

InsertText ( string text, int xPos, int yPos ) : TextPoint

Inserts a text into the document at a given column,row.

InsertText ( string text, int xPos, int yPos, bool StoreUndo ) : TextPoint

Inserts a text into the document at a given column,row.

IntPosToPoint ( int pos ) : TextPoint

Converts a char index into a Column/Row index

InvokeBookmarkAdded ( Row r ) : void
InvokeBookmarkRemoved ( Row r ) : void
InvokeBreakPointAdded ( Row r ) : void
InvokeBreakPointRemoved ( Row r ) : void
InvokeChange ( ) : void

Call this method to make the SyntaxDocument raise the Changed event

InvokeRowParsed ( Row row ) : void

Call this method to make the document raise the RowParsed event

OnApplyFormatRanges ( Row row ) : void
ParseAll ( ) : void

Performs a span parse on all rows. No Keyword colorizing

ParseAll ( bool ParseKeywords ) : void

Parses all rows , either a span parse or a full parse with keyword colorizing

ParseRow ( Row r ) : void

Forces a row to be parsed

ParseRow ( Row r, bool ParseKeywords ) : void

Forces a row to be parsed

ParseSome ( ) : void

Parses a chunk of 1000 rows , this is not thread safe

ParseSome ( int RowCount ) : void

Parse a chunk of rows, this is not thread safe

PointToIntPos ( TextPoint pos ) : int

Converts a Column/Row index position into a char index

PushUndoBlock ( UndoAction Action, string text, int x, int y ) : void
ReParse ( ) : void

ReParses the document

Redo ( ) : TextPoint

Perform an redo action

Remove ( int index ) : void

Remove a row at specified row index

Remove ( int index, bool StoreUndo ) : void
Remove ( int index, bool storeUndo, bool raiseChanged ) : void

Remove a row at specified row index

ResetVisibleRows ( ) : void

Call this method to recalculate the visible rows

SetSyntaxFromEmbeddedResource ( Assembly assembly, String resourceName ) : void

Sets a syntax file, from an embedded resource.

StartUndoCapture ( ) : void

Starts an Undo Capture. This method can be called if you with to collect multiple text operations into one undo action

SyntaxDocument ( ) : System

SyntaxDocument ( IContainer container ) : System

ToggleRow ( Row r ) : void

Toggle expansion of a given row

UnFoldAll ( ) : void

UnFolds all foldable rows

Undo ( ) : TextPoint

Perform an undo action

clear ( ) : void

Clear all content in the document

this ( int index ) : Row

Returns the row at the specified index

Méthodes protégées

Méthode Description
OnBookmarkAdded ( Row r ) : void
OnBookmarkRemoved ( Row r ) : void
OnBreakPointAdded ( Row r ) : void
OnBreakPointRemoved ( Row r ) : void
OnUndoBufferChanged ( ) : void

Private Methods

Méthode Description
Init ( ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InternalResetVisibleRows ( ) : void
OnChange ( ) : void
OnModifiedChanged ( ) : void
OnRowDeleted ( Row r ) : void
OnRowParsed ( Row r ) : void
ParseRows ( Row row ) : int
ParseRows ( Row row, bool Keywords ) : int

Method Details

Add() public méthode

Add a new row with the specified text to the bottom of the document
public Add ( string text ) : Row
text string Text to add
Résultat Row

Add() public méthode

Add a new row with the specified text to the bottom of the document
public Add ( string text, bool StoreUndo ) : Row
text string Text to add
StoreUndo bool true if and undo action should be added to the undo stack
Résultat Row

AddToUndoList() public méthode

public AddToUndoList ( UndoBlock undo ) : void
undo UndoBlock
Résultat void

AddToUndoList() public méthode

Add an action to the undo stack
public AddToUndoList ( UndoBlockCollection ActionGroup ) : void
ActionGroup UndoBlockCollection action to add
Résultat void

AutoIndentSegment() public méthode

public AutoIndentSegment ( Span span ) : void
span Span
Résultat void

ChangeVersion() public méthode

For internal use only
public ChangeVersion ( ) : void
Résultat void

Clear() public méthode

public Clear ( ) : void
Résultat void

ClearBookmarks() public méthode

Removes all bookmarks in the document
public ClearBookmarks ( ) : void
Résultat void

ClearBreakpoints() public méthode

Removes all breakpoints in the document.
public ClearBreakpoints ( ) : void
Résultat void

DeleteRange() public méthode

Deletes a range of text
public DeleteRange ( TextRange Range ) : void
Range TextRange the range that should be deleted
Résultat void

DeleteRange() public méthode

Deletes a range of text
public DeleteRange ( TextRange Range, bool StoreUndo ) : void
Range TextRange Range to delete
StoreUndo bool true if the actions should be pushed onto the undo stack
Résultat void

EndUndoCapture() public méthode

Ends an Undo capture and pushes the collected actions onto the undostack StartUndoCapture
public EndUndoCapture ( ) : UndoBlockCollection
Résultat UndoBlockCollection

EnsureParsed() public méthode

Call this method to ensure that a specific row is fully parsed
public EnsureParsed ( Row Row ) : void
Row Row
Résultat void

FoldAll() public méthode

Folds all foldable rows
public FoldAll ( ) : void
Résultat void

GetEndBracketWord() public méthode

public GetEndBracketWord ( Word Start, Pattern End, Span FindIn ) : Word
Start Word
End Pattern
FindIn Span
Résultat Word

GetEnumerator() public méthode

public GetEnumerator ( ) : IEnumerator
Résultat IEnumerator

GetFormatWordFromPos() public méthode

Gets a Word object form a given column , Row index (this only applies if the row is fully parsed)
public GetFormatWordFromPos ( TextPoint p ) : Word
p TextPoint Column and Rowindex
Résultat Word

GetNextBookmark() public méthode

Gets the row index of the next bookmarked row
public GetNextBookmark ( int StartIndex ) : int
StartIndex int Start index
Résultat int

GetPreviousBookmark() public méthode

Gets the row index of the previous bookmarked row
public GetPreviousBookmark ( int StartIndex ) : int
StartIndex int Start index
Résultat int

GetRange() public méthode

Get a range of text
public GetRange ( TextRange Range ) : string
Range TextRange The range to get
Résultat string

GetRangeFromText() public méthode

Gets a Range from a given text
public GetRangeFromText ( string text, int xPos, int yPos ) : TextRange
text string
xPos int
yPos int
Résultat TextRange

GetSegmentFromPos() public méthode

Gets a span object form a given column , Row index (This only applies if the row is fully parsed)
public GetSegmentFromPos ( TextPoint p ) : Span
p TextPoint Column and Rowindex
Résultat Span

GetStartBracketWord() public méthode

public GetStartBracketWord ( Word Start, Pattern End, Span FindIn ) : Word
Start Word
End Pattern
FindIn Span
Résultat Word

GetWordFromPos() public méthode

Gets a Word object form a given column , Row index (this only applies if the row is fully parsed)
public GetWordFromPos ( TextPoint p ) : Word
p TextPoint Column and Rowindex
Résultat Word

IndexOf() public méthode

Returns the index of a given row
public IndexOf ( Row xtr ) : int
xtr Row row to find
Résultat int

Insert() public méthode

Insert a text at the specified row index
public Insert ( string text, int index ) : Row
text string Text to insert
index int Row index where the text should be inserted
Résultat Row

Insert() public méthode

Insert a text at the specified row index
public Insert ( string text, int index, bool storeUndo ) : Row
text string Text to insert
index int Row index where the text should be inserted
storeUndo bool true if and undo action should be added to the undo stack
Résultat Row

InsertText() public méthode

Inserts a text into the document at a given column,row.
public InsertText ( string text, int xPos, int yPos ) : TextPoint
text string Text to insert
xPos int Column
yPos int Row index
Résultat TextPoint

InsertText() public méthode

Inserts a text into the document at a given column,row.
public InsertText ( string text, int xPos, int yPos, bool StoreUndo ) : TextPoint
text string Text to insert
xPos int Column
yPos int Row index
StoreUndo bool true if this action should be pushed onto the undo stack
Résultat TextPoint

IntPosToPoint() public méthode

Converts a char index into a Column/Row index
public IntPosToPoint ( int pos ) : TextPoint
pos int Char index to convert
Résultat TextPoint

InvokeBookmarkAdded() public méthode

public InvokeBookmarkAdded ( Row r ) : void
r Row
Résultat void

InvokeBookmarkRemoved() public méthode

public InvokeBookmarkRemoved ( Row r ) : void
r Row
Résultat void

InvokeBreakPointAdded() public méthode

public InvokeBreakPointAdded ( Row r ) : void
r Row
Résultat void

InvokeBreakPointRemoved() public méthode

public InvokeBreakPointRemoved ( Row r ) : void
r Row
Résultat void

InvokeChange() public méthode

Call this method to make the SyntaxDocument raise the Changed event
public InvokeChange ( ) : void
Résultat void

InvokeRowParsed() public méthode

Call this method to make the document raise the RowParsed event
public InvokeRowParsed ( Row row ) : void
row Row
Résultat void

OnApplyFormatRanges() public méthode

public OnApplyFormatRanges ( Row row ) : void
row Row
Résultat void

OnBookmarkAdded() protected méthode

protected OnBookmarkAdded ( Row r ) : void
r Row
Résultat void

OnBookmarkRemoved() protected méthode

protected OnBookmarkRemoved ( Row r ) : void
r Row
Résultat void

OnBreakPointAdded() protected méthode

protected OnBreakPointAdded ( Row r ) : void
r Row
Résultat void

OnBreakPointRemoved() protected méthode

protected OnBreakPointRemoved ( Row r ) : void
r Row
Résultat void

OnUndoBufferChanged() protected méthode

protected OnUndoBufferChanged ( ) : void
Résultat void

ParseAll() public méthode

Performs a span parse on all rows. No Keyword colorizing
public ParseAll ( ) : void
Résultat void

ParseAll() public méthode

Parses all rows , either a span parse or a full parse with keyword colorizing
public ParseAll ( bool ParseKeywords ) : void
ParseKeywords bool
Résultat void

ParseRow() public méthode

Forces a row to be parsed
public ParseRow ( Row r ) : void
r Row Row to parse
Résultat void

ParseRow() public méthode

Forces a row to be parsed
public ParseRow ( Row r, bool ParseKeywords ) : void
r Row Row to parse
ParseKeywords bool true if keywords and operators should be parsed
Résultat void

ParseSome() public méthode

Parses a chunk of 1000 rows , this is not thread safe
public ParseSome ( ) : void
Résultat void

ParseSome() public méthode

Parse a chunk of rows, this is not thread safe
public ParseSome ( int RowCount ) : void
RowCount int The number of rows to parse
Résultat void

PointToIntPos() public méthode

Converts a Column/Row index position into a char index
public PointToIntPos ( TextPoint pos ) : int
pos TextPoint TextPoint where x is column and y is row index
Résultat int

PushUndoBlock() public méthode

public PushUndoBlock ( UndoAction Action, string text, int x, int y ) : void
Action UndoAction
text string
x int
y int
Résultat void

ReParse() public méthode

ReParses the document
public ReParse ( ) : void
Résultat void

Redo() public méthode

Perform an redo action
public Redo ( ) : TextPoint
Résultat TextPoint

Remove() public méthode

Remove a row at specified row index
public Remove ( int index ) : void
index int index of the row that should be removed
Résultat void

Remove() public méthode

public Remove ( int index, bool StoreUndo ) : void
index int
StoreUndo bool
Résultat void

Remove() public méthode

Remove a row at specified row index
public Remove ( int index, bool storeUndo, bool raiseChanged ) : void
index int index of the row that should be removed
storeUndo bool true if and undo action should be added to the undo stack
raiseChanged bool
Résultat void

ResetVisibleRows() public méthode

Call this method to recalculate the visible rows
public ResetVisibleRows ( ) : void
Résultat void

SetSyntaxFromEmbeddedResource() public méthode

Sets a syntax file, from an embedded resource.
public SetSyntaxFromEmbeddedResource ( Assembly assembly, String resourceName ) : void
assembly System.Reflection.Assembly The assembly which contains the embedded resource.
resourceName String The name of the resource.
Résultat void

StartUndoCapture() public méthode

Starts an Undo Capture. This method can be called if you with to collect multiple text operations into one undo action
public StartUndoCapture ( ) : void
Résultat void

SyntaxDocument() public méthode

public SyntaxDocument ( ) : System
Résultat System

SyntaxDocument() public méthode

public SyntaxDocument ( IContainer container ) : System
container IContainer
Résultat System

ToggleRow() public méthode

Toggle expansion of a given row
public ToggleRow ( Row r ) : void
r Row
Résultat void

UnFoldAll() public méthode

UnFolds all foldable rows
public UnFoldAll ( ) : void
Résultat void

Undo() public méthode

Perform an undo action
public Undo ( ) : TextPoint
Résultat TextPoint

clear() public méthode

Clear all content in the document
public clear ( ) : void
Résultat void

this() public méthode

Returns the row at the specified index
public this ( int index ) : Row
index int
Résultat Row

Property Details

KeywordQueue public_oe property

public RowList KeywordQueue
Résultat RowList

NeedResetRows public_oe property

Gets or Sets if folding needs to be recalculated
public bool NeedResetRows
Résultat bool

ParseQueue public_oe property

List of rows that should be parsed
public RowList ParseQueue
Résultat RowList

Parser public_oe property

The active parser of the document
public IParser Parser
Résultat IParser

Tag public_oe property

Tag property , lets the user store custom data in the row.
public object Tag
Résultat object

UndoBuffer public_oe property

Buffer containing undo actions
public UndoBuffer UndoBuffer
Résultat UndoBuffer

VisibleRows public_oe property

List of rows that is not hidden by folding
public RowList VisibleRows
Résultat RowList