C# Класс ICSharpCode.NRefactory.CSharp.CSharpFormatter

The C# Formatter generates a set of text replace actions to format a region in a C# document.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AddFormattingRegion ( DomRegion region ) : void

Adds a region in the document that should be formatted.

AnalyzeFormatting ( IDocument document, SyntaxTree syntaxTree, CancellationToken token = default(CancellationToken) ) : FormattingChanges

Analyzes the formatting of a given document and syntax tree.

CSharpFormatter ( CSharpFormattingOptions policy, ICSharpCode.NRefactory.CSharp.TextEditorOptions options = null ) : System

Initializes a new instance of the ICSharpCode.NRefactory.CSharp.CSharpFormatter class.

Format ( IDocument document ) : string

Format the specified document and gives back the formatted text as result.

Format ( string text ) : string

Format the specified text and gives back the formatted text as result.

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

Метод Описание
InternalFormat ( IDocument document ) : string

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

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

Adds a region in the document that should be formatted.
public AddFormattingRegion ( DomRegion region ) : void
region DomRegion
Результат void

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

Analyzes the formatting of a given document and syntax tree.
public AnalyzeFormatting ( IDocument document, SyntaxTree syntaxTree, CancellationToken token = default(CancellationToken) ) : FormattingChanges
document IDocument Document.
syntaxTree SyntaxTree Syntax tree.
token System.Threading.CancellationToken The cancellation token.
Результат FormattingChanges

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

Initializes a new instance of the ICSharpCode.NRefactory.CSharp.CSharpFormatter class.
public CSharpFormatter ( CSharpFormattingOptions policy, ICSharpCode.NRefactory.CSharp.TextEditorOptions options = null ) : System
policy CSharpFormattingOptions The formatting policy to use.
options ICSharpCode.NRefactory.CSharp.TextEditorOptions The text editor options (optional). Default is: TextEditorOptions.Default
Результат System

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

Format the specified document and gives back the formatted text as result.
public Format ( IDocument document ) : string
document IDocument
Результат string

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

Format the specified text and gives back the formatted text as result.
public Format ( string text ) : string
text string
Результат string