ControlAdapter.Control 속성

정의

이 컨트롤 어댑터가 결합된 컨트롤에 대한 참조를 가져옵니다.

protected:
 property System::Web::UI::Control ^ Control { System::Web::UI::Control ^ get(); };
[System.ComponentModel.Browsable(false)]
protected System.Web.UI.Control Control { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Control : System.Web.UI.Control
Protected ReadOnly Property Control As Control

속성 값

Control가 연결된 ControlAdapter입니다.

특성

예제

다음 코드 예제에서는 사용자 지정 컨트롤 Control 을 파생 하는 방법을 보여 줍니다는 클래스에서 ControlAdapter 상속 하는 해당 어댑터를 만듭니다. 어댑터는 속성을 재정의 Control 하고 컨트롤에 강력한 형식의 참조를 반환합니다.

#using <System.Web.Mobile.dll>
#using <System.dll>
#using <System.Web.dll>

using namespace System;
using namespace System::Web::UI;
using namespace System::Web::UI::Adapters;
using namespace System::Web::UI::WebControls;

public ref class CustomControl: public Control{};

public ref class CustomControlAdapter: public ControlAdapter
{
public:

   property System::Web::UI::Control^ Control 
   {
      // Return a strongly-typed reference to your custom control.
      System::Web::UI::Control^ get()
      {
         return (CustomControl^)ControlAdapter::Control;
      }
   }
   // Override other ControlAdapter members, as necessary. 
};
using System;
using System.Web.UI;
using System.Web.UI.Adapters;
using System.Web.UI.WebControls;

public class CustomControl : Control
{
    // Add your custom control code.
}

public class CustomControlAdapter : ControlAdapter
{
    // Return a strongly-typed reference to your custom control.
    public new CustomControl Control
    {
        get
        {
            return (CustomControl)base.Control;
        }

        // Override other ControlAdapter members, as necessary. 
    }
}
Imports System.Web.UI
Imports System.Web.UI.Adapters
Imports System.Web.UI.WebControls

Public Class CustomControl
    Inherits Control

    ' Add your custom control code.

End Class

Public Class CustomControlAdapter
    Inherits ControlAdapter

    ' Return a strongly-typed reference to your custom control.
    Public Shadows ReadOnly Property Control() As CustomControl
        Get
            Return CType(MyBase.Control, CustomControl)
        End Get
    End Property

    ' Override other ControlAdapter member as necessary. 

End Class

설명

파생된 컨트롤 어댑터가 컨트롤에 연결되면 .NET Framework 컨트롤 멤버 대신 특정 어댑터 멤버를 호출합니다.

상속자 참고

클래스에서 ControlAdapter 상속하는 경우 최소한 예제 섹션과 같이 컨트롤의 강력한 형식의 인스턴스를 반환하는 속성을 구현 Control 해야 합니다.

적용 대상

추가 정보