C# Класс Alsing.SourceCode.SyntaxDocument

The SyntaxDocument is a component that is responsible for Parsing , Folding , Undo / Redo actions and various text actions.
Наследование: System.ComponentModel.Component, IEnumerable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
KeywordQueue RowList
NeedResetRows bool
ParseQueue RowList
Parser IParser
Tag object
UndoBuffer UndoBuffer
VisibleRows RowList

Private Properties

Свойство Тип Описание
Init void
InitializeComponent void
InternalResetVisibleRows void
OnChange void
OnModifiedChanged void
OnRowDeleted void
OnRowParsed void
ParseRows int
ParseRows int

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

Метод Описание
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

Защищенные методы

Метод Описание
OnBookmarkAdded ( Row r ) : void
OnBookmarkRemoved ( Row r ) : void
OnBreakPointAdded ( Row r ) : void
OnBreakPointRemoved ( Row r ) : void
OnUndoBufferChanged ( ) : void

Приватные методы

Метод Описание
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

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

Add() публичный метод

Add a new row with the specified text to the bottom of the document
public Add ( string text ) : Row
text string Text to add
Результат Row

Add() публичный метод

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
Результат Row

AddToUndoList() публичный метод

public AddToUndoList ( UndoBlock undo ) : void
undo UndoBlock
Результат void

AddToUndoList() публичный метод

Add an action to the undo stack
public AddToUndoList ( UndoBlockCollection ActionGroup ) : void
ActionGroup UndoBlockCollection action to add
Результат void

AutoIndentSegment() публичный метод

public AutoIndentSegment ( Span span ) : void
span Span
Результат void

ChangeVersion() публичный метод

For internal use only
public ChangeVersion ( ) : void
Результат void

Clear() публичный метод

public Clear ( ) : void
Результат void

ClearBookmarks() публичный метод

Removes all bookmarks in the document
public ClearBookmarks ( ) : void
Результат void

ClearBreakpoints() публичный метод

Removes all breakpoints in the document.
public ClearBreakpoints ( ) : void
Результат void

DeleteRange() публичный метод

Deletes a range of text
public DeleteRange ( TextRange Range ) : void
Range TextRange the range that should be deleted
Результат void

DeleteRange() публичный метод

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
Результат void

EndUndoCapture() публичный метод

Ends an Undo capture and pushes the collected actions onto the undostack StartUndoCapture
public EndUndoCapture ( ) : UndoBlockCollection
Результат UndoBlockCollection

EnsureParsed() публичный метод

Call this method to ensure that a specific row is fully parsed
public EnsureParsed ( Row Row ) : void
Row Row
Результат void

FoldAll() публичный метод

Folds all foldable rows
public FoldAll ( ) : void
Результат void

GetEndBracketWord() публичный метод

public GetEndBracketWord ( Word Start, Pattern End, Span FindIn ) : Word
Start Word
End Pattern
FindIn Span
Результат Word

GetEnumerator() публичный метод

public GetEnumerator ( ) : IEnumerator
Результат IEnumerator

GetFormatWordFromPos() публичный метод

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
Результат Word

GetNextBookmark() публичный метод

Gets the row index of the next bookmarked row
public GetNextBookmark ( int StartIndex ) : int
StartIndex int Start index
Результат int

GetPreviousBookmark() публичный метод

Gets the row index of the previous bookmarked row
public GetPreviousBookmark ( int StartIndex ) : int
StartIndex int Start index
Результат int

GetRange() публичный метод

Get a range of text
public GetRange ( TextRange Range ) : string
Range TextRange The range to get
Результат string

GetRangeFromText() публичный метод

Gets a Range from a given text
public GetRangeFromText ( string text, int xPos, int yPos ) : TextRange
text string
xPos int
yPos int
Результат TextRange

GetSegmentFromPos() публичный метод

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
Результат Span

GetStartBracketWord() публичный метод

public GetStartBracketWord ( Word Start, Pattern End, Span FindIn ) : Word
Start Word
End Pattern
FindIn Span
Результат Word

GetWordFromPos() публичный метод

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
Результат Word

IndexOf() публичный метод

Returns the index of a given row
public IndexOf ( Row xtr ) : int
xtr Row row to find
Результат int

Insert() публичный метод

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
Результат Row

Insert() публичный метод

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
Результат Row

InsertText() публичный метод

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
Результат TextPoint

InsertText() публичный метод

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
Результат TextPoint

IntPosToPoint() публичный метод

Converts a char index into a Column/Row index
public IntPosToPoint ( int pos ) : TextPoint
pos int Char index to convert
Результат TextPoint

InvokeBookmarkAdded() публичный метод

public InvokeBookmarkAdded ( Row r ) : void
r Row
Результат void

InvokeBookmarkRemoved() публичный метод

public InvokeBookmarkRemoved ( Row r ) : void
r Row
Результат void

InvokeBreakPointAdded() публичный метод

public InvokeBreakPointAdded ( Row r ) : void
r Row
Результат void

InvokeBreakPointRemoved() публичный метод

public InvokeBreakPointRemoved ( Row r ) : void
r Row
Результат void

InvokeChange() публичный метод

Call this method to make the SyntaxDocument raise the Changed event
public InvokeChange ( ) : void
Результат void

InvokeRowParsed() публичный метод

Call this method to make the document raise the RowParsed event
public InvokeRowParsed ( Row row ) : void
row Row
Результат void

OnApplyFormatRanges() публичный метод

public OnApplyFormatRanges ( Row row ) : void
row Row
Результат void

OnBookmarkAdded() защищенный метод

protected OnBookmarkAdded ( Row r ) : void
r Row
Результат void

OnBookmarkRemoved() защищенный метод

protected OnBookmarkRemoved ( Row r ) : void
r Row
Результат void

OnBreakPointAdded() защищенный метод

protected OnBreakPointAdded ( Row r ) : void
r Row
Результат void

OnBreakPointRemoved() защищенный метод

protected OnBreakPointRemoved ( Row r ) : void
r Row
Результат void

OnUndoBufferChanged() защищенный метод

protected OnUndoBufferChanged ( ) : void
Результат void

ParseAll() публичный метод

Performs a span parse on all rows. No Keyword colorizing
public ParseAll ( ) : void
Результат void

ParseAll() публичный метод

Parses all rows , either a span parse or a full parse with keyword colorizing
public ParseAll ( bool ParseKeywords ) : void
ParseKeywords bool
Результат void

ParseRow() публичный метод

Forces a row to be parsed
public ParseRow ( Row r ) : void
r Row Row to parse
Результат void

ParseRow() публичный метод

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
Результат void

ParseSome() публичный метод

Parses a chunk of 1000 rows , this is not thread safe
public ParseSome ( ) : void
Результат void

ParseSome() публичный метод

Parse a chunk of rows, this is not thread safe
public ParseSome ( int RowCount ) : void
RowCount int The number of rows to parse
Результат void

PointToIntPos() публичный метод

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
Результат int

PushUndoBlock() публичный метод

public PushUndoBlock ( UndoAction Action, string text, int x, int y ) : void
Action UndoAction
text string
x int
y int
Результат void

ReParse() публичный метод

ReParses the document
public ReParse ( ) : void
Результат void

Redo() публичный метод

Perform an redo action
public Redo ( ) : TextPoint
Результат TextPoint

Remove() публичный метод

Remove a row at specified row index
public Remove ( int index ) : void
index int index of the row that should be removed
Результат void

Remove() публичный метод

public Remove ( int index, bool StoreUndo ) : void
index int
StoreUndo bool
Результат void

Remove() публичный метод

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
Результат void

ResetVisibleRows() публичный метод

Call this method to recalculate the visible rows
public ResetVisibleRows ( ) : void
Результат void

SetSyntaxFromEmbeddedResource() публичный метод

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.
Результат void

StartUndoCapture() публичный метод

Starts an Undo Capture. This method can be called if you with to collect multiple text operations into one undo action
public StartUndoCapture ( ) : void
Результат void

SyntaxDocument() публичный метод

public SyntaxDocument ( ) : System
Результат System

SyntaxDocument() публичный метод

public SyntaxDocument ( IContainer container ) : System
container IContainer
Результат System

ToggleRow() публичный метод

Toggle expansion of a given row
public ToggleRow ( Row r ) : void
r Row
Результат void

UnFoldAll() публичный метод

UnFolds all foldable rows
public UnFoldAll ( ) : void
Результат void

Undo() публичный метод

Perform an undo action
public Undo ( ) : TextPoint
Результат TextPoint

clear() публичный метод

Clear all content in the document
public clear ( ) : void
Результат void

this() публичный метод

Returns the row at the specified index
public this ( int index ) : Row
index int
Результат Row

Описание свойств

KeywordQueue публичное свойство

public RowList KeywordQueue
Результат RowList

NeedResetRows публичное свойство

Gets or Sets if folding needs to be recalculated
public bool NeedResetRows
Результат bool

ParseQueue публичное свойство

List of rows that should be parsed
public RowList ParseQueue
Результат RowList

Parser публичное свойство

The active parser of the document
public IParser Parser
Результат IParser

Tag публичное свойство

Tag property , lets the user store custom data in the row.
public object Tag
Результат object

UndoBuffer публичное свойство

Buffer containing undo actions
public UndoBuffer UndoBuffer
Результат UndoBuffer

VisibleRows публичное свойство

List of rows that is not hidden by folding
public RowList VisibleRows
Результат RowList