DeviceSpecificChoice 클래스

정의

주의

The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.

DeviceSpecific/Choice 구문 내에 단일 선택 항목을 제공합니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

public ref class DeviceSpecificChoice : System::Web::UI::IAttributeAccessor, System::Web::UI::IParserAccessor
[System.Web.UI.MobileControls.PersistName("Choice")]
public class DeviceSpecificChoice : System.Web.UI.IAttributeAccessor, System.Web.UI.IParserAccessor
[System.Web.UI.MobileControls.PersistName("Choice")]
[System.Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public class DeviceSpecificChoice : System.Web.UI.IAttributeAccessor, System.Web.UI.IParserAccessor
[<System.Web.UI.MobileControls.PersistName("Choice")>]
type DeviceSpecificChoice = class
    interface IParserAccessor
    interface IAttributeAccessor
[<System.Web.UI.MobileControls.PersistName("Choice")>]
[<System.Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")>]
type DeviceSpecificChoice = class
    interface IParserAccessor
    interface IAttributeAccessor
Public Class DeviceSpecificChoice
Implements IAttributeAccessor, IParserAccessor
상속
DeviceSpecificChoice
특성
구현

예제

다음 코드 예제에서는 이미지 내의 <Choice> 요소를 보여줍니다. 특성은 Source 컨트롤의 ImageUrl 속성을 재정의 Image 합니다.

이 예제에서는 함수를 사용하여 브라우저에 WML()이 필요한지 또는 색(isWML11supportsColor)을 지원하는지 여부를 결정하지만, 대신 Web.config 파일을 사용하여 .NET Framework 자동으로 사용하여 결정을 내리는 데 사용하는 요소를 정의 <DeviceSpecific> 할 수 있습니다.

참고

다음 코드 샘플 단일 파일 코드 모델을 사용 하 고 코드 숨김 파일에 직접 복사 하는 경우 제대로 작동 하지 않을 수 있습니다. 이 코드 샘플.aspx 확장명이 있는 빈 텍스트 파일에 복사 해야 합니다. 자세한 내용은 ASP.NET Web Forms 페이지 구문 개요를 참조하세요.

<%@ Page Language="C#" 
    Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" %>
<%@ Import Namespace="System.Web.Mobile" %>

<script runat="server">
    private bool supportsColor(MobileCapabilities caps, string optValue)
    {
        // Determine if the browser is not a Web crawler and
        // can display in color
        if (!caps.Crawler && caps.IsColor)
            return true;
        return false;
    }

    private bool isWML11(MobileCapabilities caps, string optValue)
    {
        // Determine if the browser is not a Web crawler and
        // requires WML markup
        if (!caps.Crawler && caps.PreferredRenderingType ==
            MobileCapabilities.PreferredRenderingTypeWml11)
            return true;
        return false;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="form1" runat="server">
        <mobile:Image ID="Image1" runat="server" 
            AlternateText="Cannot display this image.">
            <DeviceSpecific>
                <choice Filter ="isWML11" ImageURL="wmlImage.wbmp" />
                <choice Filter="supportsColor" ImageURL="colorImage.gif" />
                <choice ImageURL="monoImg.gif" />
            </DeviceSpecific>
        </mobile:Image>
    </mobile:form>
</body>
</html>
<%@ Page Language="VB" 
    Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" %>
<%@ Import Namespace="System.Web.Mobile" %>

<script runat="server">
    Private Function supportsColor(ByVal caps As MobileCapabilities, _
        ByVal value As String) As Boolean
        
        ' Determine if the browser is not a Web crawler and
        ' can display in color
        If Not caps.Crawler And caps.IsColor Then
            Return True
        Else
            Return False
        End If
    End Function

    Private Function isWML11(ByVal caps As MobileCapabilities, _
        ByVal value As String) As Boolean

        ' Determine if the browser is not a Web crawler and
        ' requires WML markup
        If (Not caps.Crawler) AndAlso caps.PreferredRenderingType = _
            MobileCapabilities.PreferredRenderingTypeWml11 Then
            Return True
        Else
            Return False
        End If
    End Function
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="form1" runat="server">
        <mobile:Image ID="Image1" runat="server" 
            AlternateText="Cannot display this image.">
            <DeviceSpecific>
                <choice Filter ="isWML11" ImageURL="wmlImage.wbmp" />
                <choice Filter="supportsColor" ImageURL="colorImage.gif" />
                <choice ImageURL="monoImg.gif" />
            </DeviceSpecific>
        </mobile:Image>
    </mobile:form>
</body>
</html>

설명

이 클래스는 Choice> 요소와< 유사합니다. 선택 항목은 DeviceSpecific> 요소 내에 표시되는 순서대로< 테스트됩니다. 지정 하는 경우는 Filter 의 속성을 <Choice> 요소를 해당 값에 정의 된 디바이스 필터의 이름 이어야 합니다는 <deviceFilters> 합니다 Machine.config 파일의 섹션. ASP.NET은 런타임 시 현재 디바이스의 기능에 대해 지정 된 디바이스 필터를 평가합니다. 성공하면 선택이 선택됩니다. 속성을 지정 Filter 하지 않으면 요소의 기본값이 <Choice> 선택됩니다.

생성자

DeviceSpecificChoice()
사용되지 않음.

DeviceSpecificChoice 클래스의 새 인스턴스를 초기화합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

속성

Argument
사용되지 않음.

Filter 속성에 사용되는 인수를 가져오거나 설정합니다. 기본값은 null입니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

Contents
사용되지 않음.

DeviceSpecific/Choice 구문의 선택 항목에 정의되어 있는 재정의된 속성을 가져옵니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

Filter
사용되지 않음.

디바이스 필터의 이름을 가져오거나 설정합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

HasTemplates
사용되지 않음.

DeviceSpecific 요소에서 현재 선택된 선택 항목에 <템플릿이 정의되어 있는지 여부를 나타내는 값을 가져옵니다.> 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

Templates
사용되지 않음.

Choice 요소에 정의된 템플릿을 <가져옵니다.> 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

Xmlns
사용되지 않음.

Choice 요소의 태그 형식을 <가져오거나 설정합니다.> 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

메서드

AddParsedSubObject(Object)
사용되지 않음.

ObjectDeviceSpecificChoice 개체의 Templates 개체에 추가합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

Equals(Object)
사용되지 않음.

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetAttribute(String)
사용되지 않음.

DeviceSpecificChoice 개체에서 지정된 특성을 반환합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

GetHashCode()
사용되지 않음.

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()
사용되지 않음.

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()
사용되지 않음.

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
SetAttribute(String, String)
사용되지 않음.

주어진 값을 키로 지정된 특성에 할당합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

ToString()
사용되지 않음.

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IAttributeAccessor.GetAttribute(String)

이 API는 제품 인프라를 지원하며 코드에서 직접 사용되지 않습니다.

사용되지 않음.

이 멤버에 대한 설명은 GetAttribute(String)를 참조하세요. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

IAttributeAccessor.SetAttribute(String, String)

이 API는 제품 인프라를 지원하며 코드에서 직접 사용되지 않습니다.

사용되지 않음.

이 멤버에 대한 설명은 SetAttribute(String, String)를 참조하세요. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

IParserAccessor.AddParsedSubObject(Object)
사용되지 않음.

이 멤버에 대한 설명은 AddParsedSubObject(Object)를 참조하세요. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

적용 대상

추가 정보