CodeGenerator.GenerateCodeFromMember Method (CodeTypeMember, TextWriter, CodeGeneratorOptions)

 

Generates code for the specified class member using the specified text writer and code generator options.

Namespace:   System.CodeDom.Compiler
Assembly:  System (in System.dll)

public virtual void GenerateCodeFromMember(
	CodeTypeMember member,
	TextWriter writer,
	CodeGeneratorOptions options
)

Parameters

member
Type: System.CodeDom.CodeTypeMember

The class member to generate code for.

writer
Type: System.IO.TextWriter

The text writer to output code to.

options
Type: System.CodeDom.Compiler.CodeGeneratorOptions

The options to use when generating the code.

Exception Condition
InvalidOperationException

The Output property is not null.

Code for members is generated differently depending on the context. For example, code for methods on an interface or fields on an enumeration is generated differently from code for the same member on a class. This implementation assumes that the member is being generated for the class context.

.NET Framework
Available since 2.0
Return to top
Show: