CodeDomProvider.CreateGenerator CodeDomProvider.CreateGenerator CodeDomProvider.CreateGenerator CodeDomProvider.CreateGenerator Method

Definition

When overridden in a derived class, creates a new code generator.

Overloads

CreateGenerator() CreateGenerator() CreateGenerator() CreateGenerator()

When overridden in a derived class, creates a new code generator.

CreateGenerator(TextWriter) CreateGenerator(TextWriter) CreateGenerator(TextWriter) CreateGenerator(TextWriter)

When overridden in a derived class, creates a new code generator using the specified TextWriter for output.

CreateGenerator(String) CreateGenerator(String) CreateGenerator(String) CreateGenerator(String)

When overridden in a derived class, creates a new code generator using the specified file name for output.

CreateGenerator() CreateGenerator() CreateGenerator() CreateGenerator()

Warning

This API is now obsolete.

When overridden in a derived class, creates a new code generator.

public:
 abstract System::CodeDom::Compiler::ICodeGenerator ^ CreateGenerator();
[System.Obsolete("ICodeGenerator is obsolete")]
[System.Obsolete("Callers should not use the ICodeGenerator interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.")]
public abstract System.CodeDom.Compiler.ICodeGenerator CreateGenerator ();
abstract member CreateGenerator : unit -> System.CodeDom.Compiler.ICodeGenerator
Public MustOverride Function CreateGenerator () As ICodeGenerator

Returns

An ICodeGenerator that can be used to generate System.CodeDom based source code representations.

Remarks

This method is obsolete in the .NET Framework 2.0. The recommended alternative is to call the ICodeGenerator methods that are directly available in the CodeDomProvider class.

Notes to Inheritors

In the .NET Framework 2.0, you should implement the ICodeGenerator members in the CodeDomProvider class and throw a NotSupportedException when this method is called.

CreateGenerator(TextWriter) CreateGenerator(TextWriter) CreateGenerator(TextWriter) CreateGenerator(TextWriter)

When overridden in a derived class, creates a new code generator using the specified TextWriter for output.

public:
 virtual System::CodeDom::Compiler::ICodeGenerator ^ CreateGenerator(System::IO::TextWriter ^ output);
public virtual System.CodeDom.Compiler.ICodeGenerator CreateGenerator (System.IO.TextWriter output);
abstract member CreateGenerator : System.IO.TextWriter -> System.CodeDom.Compiler.ICodeGenerator
override this.CreateGenerator : System.IO.TextWriter -> System.CodeDom.Compiler.ICodeGenerator
Public Overridable Function CreateGenerator (output As TextWriter) As ICodeGenerator

Parameters

Returns

An ICodeGenerator that can be used to generate System.CodeDom based source code representations.

Remarks

This method uses the specified TextWriter for output. This method supports more optimized code generation that incrementally updates the source code.

Note

The base class implementation calls the CreateGenerator method, which is obsolete in the .NET Framework 2.0 and results in a NotSupportedException if an ICodeGenerator object is not returned.

See also

CreateGenerator(String) CreateGenerator(String) CreateGenerator(String) CreateGenerator(String)

When overridden in a derived class, creates a new code generator using the specified file name for output.

public:
 virtual System::CodeDom::Compiler::ICodeGenerator ^ CreateGenerator(System::String ^ fileName);
public virtual System.CodeDom.Compiler.ICodeGenerator CreateGenerator (string fileName);
abstract member CreateGenerator : string -> System.CodeDom.Compiler.ICodeGenerator
override this.CreateGenerator : string -> System.CodeDom.Compiler.ICodeGenerator
Public Overridable Function CreateGenerator (fileName As String) As ICodeGenerator

Parameters

fileName
String String String String

The file name to output to.

Returns

An ICodeGenerator that can be used to generate System.CodeDom based source code representations.

Remarks

This method uses the specified file name for output.

Note

The base class implementation calls the CreateGenerator method, which is obsolete in the .NET Framework 2.0 and results in a NotSupportedException if an ICodeGenerator object is not returned.

Applies to