void ICodeGenerator.GenerateCodeFromStatement(CodeStatement e, TextWriter w, CodeGeneratorOptions o) { bool setLocal = false; if (_output != null && w != _output.InnerWriter) { throw new InvalidOperationException(SR.CodeGenOutputWriter); } if (_output == null) { setLocal = true; _options = o ?? new CodeGeneratorOptions(); _output = new ExposedTabStringIndentedTextWriter(w, _options.IndentString); } try { GenerateStatement(e); } finally { if (setLocal) { _output = null; _options = null; } } }
public virtual void GenerateCodeFromMember(CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options) { if (_output != null) { throw new InvalidOperationException(SR.CodeGenReentrance); } _options = options ?? new CodeGeneratorOptions(); _output = new ExposedTabStringIndentedTextWriter(writer, _options.IndentString); try { CodeTypeDeclaration dummyClass = new CodeTypeDeclaration(); _currentClass = dummyClass; GenerateTypeMember(member, dummyClass); } finally { _currentClass = null; _output = null; _options = null; } }
void ICodeGenerator.GenerateCodeFromStatement(CodeStatement e, TextWriter w, CodeGeneratorOptions o) { bool setLocal = false; if (_output != null && w != _output.InnerWriter) { throw new InvalidOperationException(SR.CodeGenOutputWriter); } if (_output == null) { setLocal = true; _options = o ?? new CodeGeneratorOptions(); _output = new ExposedTabStringIndentedTextWriter(w, _options.IndentString); } try { GenerateStatement(e); } finally { if (setLocal) { _output = null; _options = null; } } }
internal Indentation(ExposedTabStringIndentedTextWriter writer, int indent) { _writer = writer; _indent = indent; }
internal Indentation(ExposedTabStringIndentedTextWriter writer, int indent) { _writer = writer; _indent = indent; }