Style.RegisterStyle(String, Type, Object, Boolean) 메서드

정의

스타일 속성을 등록하고 조회에 사용할 고유 키를 반환합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

public:
 static System::Object ^ RegisterStyle(System::String ^ name, Type ^ type, System::Object ^ defaultValue, bool inherit);
public static object RegisterStyle (string name, Type type, object defaultValue, bool inherit);
static member RegisterStyle : string * Type * obj * bool -> obj
Public Shared Function RegisterStyle (name As String, type As Type, defaultValue As Object, inherit As Boolean) As Object

매개 변수

name
String

스타일 속성 이름입니다.

type
Type

속성에 사용되는 형식입니다.

defaultValue
Object

속성의 기본값입니다.

inherit
Boolean

스타일이 부모 개체에서 상속되는지 여부를 나타냅니다. 기본값은 true입니다.

반환

조회에 사용할 고유 키입니다.

예제

다음 예제에서는 사용 하는 RegisterStyle 방법에 설명 합니다 상속을 지원 하는 문자열 속성을 등록 하는 메서드 및 기본값은 빈 문자열 ("")입니다. 이 불완전한 예제에는 기본 클래스의 기본 인덱서 속성을 사용하여 구현이 이 속성의 요소에 액세스하는 public 속성이 포함됩니다.

public class CustomStyle : 
    System.Web.UI.MobileControls.Style
    {
        private string themeNameKey;

        public CustomStyle(string name)
        {
            themeNameKey = 
                RegisterStyle(name, typeof(String), 
                    String.Empty, true).ToString();
        }
        
        public string ThemeName
        {
            get
            {
                return this[themeNameKey].ToString();
            }
            set
            {
                this[themeNameKey] = value;
            }
        }
    }
Public Class CustomStyle
    Inherits System.Web.UI.MobileControls.Style
    Private themeNameKey As String

    Public Sub New(ByVal name As String)
        themeNameKey = _
            RegisterStyle(name, GetType(String), _
                String.Empty, True).ToString()
    End Sub
    
    Public Property ThemeName() As String
        Get
            Return Me(themeNameKey).ToString()
        End Get
        Set(ByVal value As String)
            Me(themeNameKey) = value
        End Set
    End Property
End Class

설명

상속된 스타일 클래스에서만 호출됩니다.

적용 대상

추가 정보