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.

在程式碼後端頁面模型中, baseTypeCodeTypeDeclaration 代表部分程式碼後端類別的類型,通常是衍生自 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 Web 頁面模型的詳細資訊,請參閱 ASP.NET Web Forms 頁面語法總覽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.

適用於

另請參閱