C# Class ICSharpCode.NRefactory.CSharp.CSharpFormatter

The C# Formatter generates a set of text replace actions to format a region in a C# document.
Afficher le fichier Open project: 0xd4d/NRefactory Class Usage Examples

Méthodes publiques

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

Private Methods

Méthode Description
InternalFormat ( IDocument document ) : string

Method Details

AddFormattingRegion() public méthode

Adds a region in the document that should be formatted.
public AddFormattingRegion ( DomRegion region ) : void
region DomRegion
Résultat void

AnalyzeFormatting() public méthode

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

CSharpFormatter() public méthode

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

Format() public méthode

Format the specified document and gives back the formatted text as result.
public Format ( IDocument document ) : string
document IDocument
Résultat string

Format() public méthode

Format the specified text and gives back the formatted text as result.
public Format ( string text ) : string
text string
Résultat string