Defines an interface for generating code.

See Also: ICodeGenerator Members


public interface ICodeGenerator



In the .NET Framework versions 1.0 and 1.1, code providers consist of implementations of System.CodeDom.Compiler.CodeDomProvider, System.CodeDom.Compiler.ICodeGenerator, System.CodeDom.Compiler.ICodeParser, and System.CodeDom.Compiler.ICodeCompiler. In the dnprdnlong, the CodeDomProvider.CreateGenerator, CodeDomProvider.CreateParser, and CodeDomProvider.CreateCompiler methods are obsolete, and the methods of System.CodeDom.Compiler.ICodeGenerator and System.CodeDom.Compiler.ICodeCompiler are directly available in the System.CodeDom.Compiler.CodeDomProvider class. You should override those methods in your code provider implementation and not call the base methods.

Developers of compilers can implement this interface to allow people to dynamically generate code in a particular language. This can be used for a variety of purposes, such as creating code-generating wizards, creating dynamic assemblies with content that can be debugged, and for templated documents with embedded code, such as ASP.NET.

An System.CodeDom.Compiler.ICodeGenerator implementation is typically obtained through a call to the CodeDomProvider.CreateGenerator method of System.CodeDom.Compiler.CodeDomProvider.


Namespace: System.CodeDom.Compiler
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,