C# Class ICSharpCode.AvalonEdit.Folding.XmlFoldingStrategy

Determines folds for an xml string in the editor.
ファイルを表示 Open project: kjk/kjkpub Class Usage Examples

Public Methods

Method Description
CreateNewFoldings ( TextDocument document, XmlReader reader, int &firstErrorOffset ) : IEnumerable

Create NewFoldings for the specified document.

CreateNewFoldings ( TextDocument document, int &firstErrorOffset ) : IEnumerable

Create NewFoldings for the specified document.

Private Methods

Method Description
CreateCommentFold ( TextDocument document, List foldMarkers, XmlReader reader ) : void

Creates a comment fold if the comment spans more than one line.

The text displayed when the comment is folded is the first line of the comment.

CreateElementFold ( TextDocument document, List foldMarkers, XmlReader reader, XmlFoldStart foldStart ) : void

Create an element fold if the start and end tag are on different lines.

CreateElementFoldStart ( TextDocument document, XmlReader reader ) : XmlFoldStart

Creates an XmlFoldStart for the start tag of an element.

GetAttributeFoldText ( XmlReader reader ) : string

Gets the element's attributes as a string on one line that will be displayed when the element is folded.

Currently this puts all attributes from an element on the same line of the start tag. It does not cater for elements where attributes are not on the same line as the start tag.

GetOffset ( TextDocument document, XmlReader reader ) : int
XmlEncodeAttributeValue ( string attributeValue, char quoteChar ) : string

Xml encode the attribute string since the string returned from the XmlTextReader is the plain unencoded string and .NET does not provide us with an xml encode method.

Method Details

CreateNewFoldings() public method

Create NewFoldings for the specified document.
public CreateNewFoldings ( TextDocument document, XmlReader reader, int &firstErrorOffset ) : IEnumerable
document ICSharpCode.AvalonEdit.Document.TextDocument
reader System.Xml.XmlReader
firstErrorOffset int
return IEnumerable

CreateNewFoldings() public method

Create NewFoldings for the specified document.
public CreateNewFoldings ( TextDocument document, int &firstErrorOffset ) : IEnumerable
document ICSharpCode.AvalonEdit.Document.TextDocument
firstErrorOffset int
return IEnumerable