C# Класс ServiceClientGenerator.CodeBuilder

Wrapper around string builder to help emit properly indented code
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Append ( string s ) : CodeBuilder

Append a string at the current location

AppendFormat ( string format ) : CodeBuilder

Append a formatted string at the current location.

AppendLine ( ) : CodeBuilder

Add a newline, and indent to the current indent

AppendLine ( string line ) : CodeBuilder

Append a string at the current location, add a newline and indent to the current indent.

AppendQuote ( string s, string open = @"""", string close = null ) : CodeBuilder

Append a string with quotes around it.

CloseBlock ( ) : CodeBuilder

Add a newline, reduce the indent by the tab width, and add a '}'

CodeBuilder ( StringBuilder sb, int startingIndent, int tabWidth = 4 ) : System

Constructor.

OpenBlock ( ) : CodeBuilder

Increase the indent and open a block, adding a '{' and a newline and indent.

The current position will be on a new line at the newly increased indent.

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

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

Append a string at the current location
public Append ( string s ) : CodeBuilder
s string a string
Результат CodeBuilder

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

Append a formatted string at the current location.
public AppendFormat ( string format ) : CodeBuilder
format string Format string
Результат CodeBuilder

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

Add a newline, and indent to the current indent
public AppendLine ( ) : CodeBuilder
Результат CodeBuilder

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

Append a string at the current location, add a newline and indent to the current indent.
public AppendLine ( string line ) : CodeBuilder
line string
Результат CodeBuilder

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

Append a string with quotes around it.
public AppendQuote ( string s, string open = @"""", string close = null ) : CodeBuilder
s string The string
open string The opening quote character. Defaults to double quotes.
close string The closing quote character. Defaults to the open character.
Результат CodeBuilder

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

Add a newline, reduce the indent by the tab width, and add a '}'
public CloseBlock ( ) : CodeBuilder
Результат CodeBuilder

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

Constructor.
public CodeBuilder ( StringBuilder sb, int startingIndent, int tabWidth = 4 ) : System
sb StringBuilder StringBuilder instance to wrap
startingIndent int Staring indent width (in spaces)
tabWidth int Additional indent width (in spaces)
Результат System

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

Increase the indent and open a block, adding a '{' and a newline and indent.
The current position will be on a new line at the newly increased indent.
public OpenBlock ( ) : CodeBuilder
Результат CodeBuilder