C# 클래스 Microsoft.Cci.SourceEmitter

A wrapper for a TextWriter instance that adds various methods for emitting source code in a nicely formatted way. The formatting conventions can be specified via options.
파일 보기 프로젝트 열기: visualmutator/visualmutator 1 사용 예제들

공개 메소드들

메소드 설명
EmitAnonymousMethodBodyOpeningDelimiter ( string delimiter ) : void

If this.PlaceAnonymousMethodBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.

EmitAnonymousTypeBodyOpeningDelimiter ( string delimiter ) : void

If this.PlaceAnonymousTypeBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.

EmitBlockClosingDelimiter ( string delimiter ) : void

Write out the given string and note that it is the closing delimiter of a block. If this.IdentBlockContents is true then this.IndentationLevel will be incremented before writing out the delimiter. If this.IndentBlockDelimiters is true then this.IndentationLevel will be decremented after writing out the delimiter.

EmitBlockOpeningDelimiter ( string delimiter ) : void

Write out the given string and note that it is the opening delimiter of a block. If this.IndentBlockDelimiters is true then this.IndentationLevel will be incremented before writing out the delimiter. If this.IdentBlockContents is true then this.IndentationLevel will be incremented after writing out the delimiter.

EmitCaseClosingDelimiter ( string delimiter ) : void

Write out the given string and note that it is the closing delimiter of a switch case. If this.IndentCaseContents is true then this.IndentationLevel will be decremented before writing out the delimiter.

EmitCaseOpeningDelimiter ( string delimiter ) : void

Write out the given string and note that it is the opening delimiter of a switch case. If this.IndentCaseContents is true then this.IndentationLevel will be incremented after writing out the delimiter.

EmitCatch ( string catchDelimiter ) : void

If this.PlaceCatchOnNewLine is true then a new line will be emitted, if necessary, before calling this.EmitString with the given catch delimiter string.

EmitControlBlockOpeningDelimiter ( string delimiter ) : void

If this.PlaceControlBlockOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter. A control block is the body of an loop or the true/false part of an if statement, for example.

EmitElse ( string elseDelimiter ) : void

If this.PlaceElseOnNewLine is true then a new line will be emitted, if necessary, before calling this.EmitString with the given else delimiter string.

EmitFinally ( string finallyDelimiter ) : void

If this.PlaceFinallyOnNewLine is true then a new line will be emitted, if necessary, before calling this.EmitString with the given finally delimiter string.

EmitLabel ( string label ) : void

Emits the given string, after applying the indentation rules applicable to labels.

EmitLambdaBodyOpeningDelimiter ( string delimiter ) : void

If this.PlaceLambdaBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.

EmitMethodBodyOpeningDelimiter ( string delimiter ) : void

If this.PlaceMethodBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.

EmitNewLine ( ) : void

Emits a new line character, thus starting a new source line.

EmitString ( string str ) : void

Emits the given string to the current source line. If this is the first string on the line, indentation will be emitted before the string. Note, however, that if the string is empty nothing is emitted, not even indentation.

EmitTypeBodyOpeningDelimiter ( string delimiter ) : void

If this.PlaceTypeBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.

SourceEmitter ( TextWriter textWriter ) : System

A wrapper for a TextWriter instance that adds various methods for emitting source code in a nicely formatted way. The formatting conventions can be specified via options.

비공개 메소드들

메소드 설명
IndentIfAtStartOfNewLine ( ) : void

If nothing has yet been written to the current line, write out this.IndentationLevel*this.IndentSize number of spaces. (Calling this again before first calling EmitNewLine, will have no effect.)

ObjectInvariant ( ) : void

메소드 상세

EmitAnonymousMethodBodyOpeningDelimiter() 공개 메소드

If this.PlaceAnonymousMethodBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.
public EmitAnonymousMethodBodyOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of an anonymous method body block.
리턴 void

EmitAnonymousTypeBodyOpeningDelimiter() 공개 메소드

If this.PlaceAnonymousTypeBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.
public EmitAnonymousTypeBodyOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a anonymous type body block.
리턴 void

EmitBlockClosingDelimiter() 공개 메소드

Write out the given string and note that it is the closing delimiter of a block. If this.IdentBlockContents is true then this.IndentationLevel will be incremented before writing out the delimiter. If this.IndentBlockDelimiters is true then this.IndentationLevel will be decremented after writing out the delimiter.
public EmitBlockClosingDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a block.
리턴 void

EmitBlockOpeningDelimiter() 공개 메소드

Write out the given string and note that it is the opening delimiter of a block. If this.IndentBlockDelimiters is true then this.IndentationLevel will be incremented before writing out the delimiter. If this.IdentBlockContents is true then this.IndentationLevel will be incremented after writing out the delimiter.
public EmitBlockOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a block.
리턴 void

EmitCaseClosingDelimiter() 공개 메소드

Write out the given string and note that it is the closing delimiter of a switch case. If this.IndentCaseContents is true then this.IndentationLevel will be decremented before writing out the delimiter.
public EmitCaseClosingDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a block.
리턴 void

EmitCaseOpeningDelimiter() 공개 메소드

Write out the given string and note that it is the opening delimiter of a switch case. If this.IndentCaseContents is true then this.IndentationLevel will be incremented after writing out the delimiter.
public EmitCaseOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a block.
리턴 void

EmitCatch() 공개 메소드

If this.PlaceCatchOnNewLine is true then a new line will be emitted, if necessary, before calling this.EmitString with the given catch delimiter string.
public EmitCatch ( string catchDelimiter ) : void
catchDelimiter string A string representing the start of the else part of an if statement.
리턴 void

EmitControlBlockOpeningDelimiter() 공개 메소드

If this.PlaceControlBlockOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter. A control block is the body of an loop or the true/false part of an if statement, for example.
public EmitControlBlockOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a control block.
리턴 void

EmitElse() 공개 메소드

If this.PlaceElseOnNewLine is true then a new line will be emitted, if necessary, before calling this.EmitString with the given else delimiter string.
public EmitElse ( string elseDelimiter ) : void
elseDelimiter string A string representing the start of the else part of an if statement.
리턴 void

EmitFinally() 공개 메소드

If this.PlaceFinallyOnNewLine is true then a new line will be emitted, if necessary, before calling this.EmitString with the given finally delimiter string.
public EmitFinally ( string finallyDelimiter ) : void
finallyDelimiter string A string representing the start of the else part of an if statement.
리턴 void

EmitLabel() 공개 메소드

Emits the given string, after applying the indentation rules applicable to labels.
public EmitLabel ( string label ) : void
label string The string to emit as a label.
리턴 void

EmitLambdaBodyOpeningDelimiter() 공개 메소드

If this.PlaceLambdaBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.
public EmitLambdaBodyOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a lambda body block.
리턴 void

EmitMethodBodyOpeningDelimiter() 공개 메소드

If this.PlaceMethodBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.
public EmitMethodBodyOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a method body block.
리턴 void

EmitNewLine() 공개 메소드

Emits a new line character, thus starting a new source line.
public EmitNewLine ( ) : void
리턴 void

EmitString() 공개 메소드

Emits the given string to the current source line. If this is the first string on the line, indentation will be emitted before the string. Note, however, that if the string is empty nothing is emitted, not even indentation.
public EmitString ( string str ) : void
str string The string to emit.
리턴 void

EmitTypeBodyOpeningDelimiter() 공개 메소드

If this.PlaceTypeBodyOpeningDelimitersOnNewLine is true a new line is emitted, if necessary, before calling this.EmitBlockOpeningDelimiter with the given delimiter.
public EmitTypeBodyOpeningDelimiter ( string delimiter ) : void
delimiter string A string representing the start of a type body block.
리턴 void

SourceEmitter() 공개 메소드

A wrapper for a TextWriter instance that adds various methods for emitting source code in a nicely formatted way. The formatting conventions can be specified via options.
public SourceEmitter ( TextWriter textWriter ) : System
textWriter System.IO.TextWriter The TextWriter instance to which the formatted source code is written.
리턴 System