ControlBuilder.AppendSubBuilder(ControlBuilder) 메서드

정의

컨테이너 컨트롤에 속하는 모든 자식 컨트롤에 대한 ControlBuilder 개체에 빌더를 추가합니다.Adds builders to the ControlBuilder object for any child controls that belong to the container control.

public:
 virtual void AppendSubBuilder(System::Web::UI::ControlBuilder ^ subBuilder);
public virtual void AppendSubBuilder (System.Web.UI.ControlBuilder subBuilder);
abstract member AppendSubBuilder : System.Web.UI.ControlBuilder -> unit
override this.AppendSubBuilder : System.Web.UI.ControlBuilder -> unit
Public Overridable Sub AppendSubBuilder (subBuilder As ControlBuilder)

매개 변수

subBuilder
ControlBuilder

자식 컨트롤에 할당된 ControlBuilder 개체입니다.The ControlBuilder object assigned to the child control.

예제

다음 예제에서는이 컨트롤 빌더가 적용 되는 컨트롤이 ControlCollection 클래스의 인스턴스에 컨트롤을 포함 하려는 경우 AppendSubBuilder 메서드를 재정의 하 여 Exception을 throw 합니다.The following example overrides the AppendSubBuilder method to throw an Exception if the control this control builder is applied to tries to include controls in its instance of ControlCollection class.

// Override the AppendSubBuilder method to throw an
// exception if the class it is applied to attempts
// to include child controls. 
public override void AppendSubBuilder(ControlBuilder subBuilder)
{
    throw new Exception(
        "A custom label control cannot contain other objects.");
}
' Override the AppendSubBuilder method to throw an
' exception if the class it is applied to attempts
' to include child controls. 
Public Overrides Sub AppendSubBuilder(ByVal subBuilder As ControlBuilder)
    Throw New Exception( _
       "A custom label control cannot contain other objects.")
End Sub

적용 대상

추가 정보