ControlBuilder.ProcessGeneratedCode(CodeCompileUnit, CodeTypeDeclaration, CodeTypeDeclaration, CodeMemberMethod, CodeMemberMethod) 方法

定义

启用自定义控件生成器以访问生成的代码文档对象模型 (CodeDom),并在分析和生成控件的过程中插入和修改代码。Enables custom control builders to access the generated Code Document Object Model (CodeDom) and insert and modify code during the process of parsing and building controls.

public:
 virtual void ProcessGeneratedCode(System::CodeDom::CodeCompileUnit ^ codeCompileUnit, System::CodeDom::CodeTypeDeclaration ^ baseType, System::CodeDom::CodeTypeDeclaration ^ derivedType, System::CodeDom::CodeMemberMethod ^ buildMethod, System::CodeDom::CodeMemberMethod ^ dataBindingMethod);
public virtual void ProcessGeneratedCode (System.CodeDom.CodeCompileUnit codeCompileUnit, System.CodeDom.CodeTypeDeclaration baseType, System.CodeDom.CodeTypeDeclaration derivedType, System.CodeDom.CodeMemberMethod buildMethod, System.CodeDom.CodeMemberMethod dataBindingMethod);
abstract member ProcessGeneratedCode : System.CodeDom.CodeCompileUnit * System.CodeDom.CodeTypeDeclaration * System.CodeDom.CodeTypeDeclaration * System.CodeDom.CodeMemberMethod * System.CodeDom.CodeMemberMethod -> unit
override this.ProcessGeneratedCode : System.CodeDom.CodeCompileUnit * System.CodeDom.CodeTypeDeclaration * System.CodeDom.CodeTypeDeclaration * System.CodeDom.CodeMemberMethod * System.CodeDom.CodeMemberMethod -> unit
Public Overridable Sub ProcessGeneratedCode (codeCompileUnit As CodeCompileUnit, baseType As CodeTypeDeclaration, derivedType As CodeTypeDeclaration, buildMethod As CodeMemberMethod, dataBindingMethod As CodeMemberMethod)

参数

codeCompileUnit
CodeCompileUnit

所生成控件的 CodeDOM 关系图的根容器。The root container of a CodeDOM graph of the control that is being built.

baseType
CodeTypeDeclaration

包含所生成控件的页面或用户控件的基类型。The base type of the page or user control that contains the control that is being built.

derivedType
CodeTypeDeclaration

包含所生成控件的页面或用户控件的派生类型。The derived type of the page or user control that contains the control that is being built.

buildMethod
CodeMemberMethod

用于生成控件的代码。The code that is used to build the control.

dataBindingMethod
CodeMemberMethod

用于生成控件的数据绑定方法的代码。The code that is used to build the data-binding method of the control.

注解

在单文件页模型中,baseTypederivedType 参数是相同的 CodeTypeDeclaration 类型,通常从 Page 类派生。In the single-file page model, the baseType and derivedType parameters are the same CodeTypeDeclaration type, which typically derives from the Page class.

在代码隐藏页面模型中,baseType 是表示部分代码隐藏类的 CodeTypeDeclaration 类型,通常从 Page 类派生。In the code-behind page model, baseType is the CodeTypeDeclaration type that represents the partial code-behind class, which is typically derived from the Page class. derivedType 参数是从包含标记的分部类派生的类。The derivedType parameter is the class that derives from the partial class that contains the markup.

有关 ASP.NET 网页模型的详细信息,请参阅ASP.NET Web 窗体页语法概述For more information about ASP.NET Web page models, see ASP.NET Web Forms Page Syntax Overview.

有关如何使用 CodeDOM 来表示和生成源代码的详细信息,请参阅动态源代码生成和编译For more information about how to use the CodeDOM to represent and generate source code, see Dynamic Source Code Generation and Compilation.

适用于

另请参阅