public void GenerateCodeFromMember(CodeTypeMember member, TextWriter writer, SafeCodeGeneratorOptions options) {
            if (this.output != null) {
                throw new InvalidOperationException(SR.GetString(SR.CodeGenReentrance));
            }
            this.options = (options == null) ? new SafeCodeGeneratorOptions() : options;
            this.output = new IndentedTextWriter(writer, this.options.IndentString);

            try {
                CodeTypeDeclaration dummyClass = new CodeTypeDeclaration();
                this.currentClass = dummyClass;
                GenerateTypeMember(member, dummyClass);
            }
            finally {
                this.currentClass = null;
                this.output = null;
                this.options = null;
            }
        }
        /// <internalonly/>
        void ICodeGenerator.GenerateCodeFromStatement(CodeStatement e, TextWriter w, SafeCodeGeneratorOptions o) {
            bool setLocal = false;
            if (output != null && w != output.InnerWriter) {
                throw new InvalidOperationException(SR.GetString(SR.CodeGenOutputWriter));
            }
            if (output == null) {
                setLocal = true;
                options = (o == null) ? new SafeCodeGeneratorOptions() : o;
                output = new IndentedTextWriter(w, options.IndentString);
            }

            try {
                GenerateStatement(e);
            }
            finally {
                if (setLocal) {
                    output = null;
                    options = null;
                }
            }
        }