Microsoft.Cci.SourceEmitter.EmitLabel C# (CSharp) Method

EmitLabel() public method

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.
return void
    public void EmitLabel(string label) {
      Contract.Requires(label != null);

      if (this.atTheStartOfANewLine && this.LabelIndentation != LabelIndentationKind.PlaceLabelsInLeftmostColumn) {
        int indentationLevel;
        if (this.LabelIndentation == LabelIndentationKind.PlaceLabelsOneIndentationLessThanCurrentLevel)
          indentationLevel = this.IndentationLevel-1;
        else
          indentationLevel = this.IndentationLevel;
        for (int i = 0, n = indentationLevel*this.IndentSize; i < n; i++)
          this.textWriter.Write(' ');
        this.atTheStartOfANewLine = false;         
      }
      this.textWriter.Write(label);
    }