DeviceSpecificChoiceCollection クラス

定義

注意事項

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 クラスの選択項目のコレクションを表します。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

public ref class DeviceSpecificChoiceCollection : System::Web::UI::MobileControls::ArrayListCollectionBase
public class DeviceSpecificChoiceCollection : System.Web.UI.MobileControls.ArrayListCollectionBase
[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 DeviceSpecificChoiceCollection : System.Web.UI.MobileControls.ArrayListCollectionBase
type DeviceSpecificChoiceCollection = class
    inherit ArrayListCollectionBase
[<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 DeviceSpecificChoiceCollection = class
    inherit ArrayListCollectionBase
Public Class DeviceSpecificChoiceCollection
Inherits ArrayListCollectionBase
継承
DeviceSpecificChoiceCollection
属性

次のコード例は、 クラスを DeviceSpecificChoiceCollection 使用して DeviceSpecific/Choice コンストラクトの選択肢にアクセスする方法を示しています。 便宜上、フィルターを含む Web.config ファイルはコード例に従います。

Note

次のコード サンプルでは、単一ファイル コード モデルを使用しており、分離コード ファイルに直接コピーすると正しく動作しない場合があります。 このコード サンプルは、拡張子が .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">
    public void Page_Load(Object sender, EventArgs e)
    {
        int count = this.Panel1.DeviceSpecific.Choices.Count;

        // Cycle through the DeviceSpecificChoiceCollection.
        for (int i = 0; i < count; i++)
        {
            string txt1 = "Choice {0} has {1} Templates. ";
            string txt2 = "Filter name is '{0}'. ";

            Label1.Text += String.Format(txt1, i,
                Panel1.DeviceSpecific.Choices[i].Templates.Count);
            Label2.Text += String.Format(txt2,
                Panel1.DeviceSpecific.Choices[i].Filter);
        }
    }

    //<Snippet3>
    // Add a DeviceSpecificChoice section programatically
    protected void form1_Init(object sender, EventArgs e)
    {
        DeviceSpecific devSpecific = Panel1.DeviceSpecific;
        DeviceSpecificChoice devChoiceHtml = new DeviceSpecificChoice();
        devChoiceHtml.Filter = "isCHTML10";
        devSpecific.Choices.Add(devChoiceHtml);
        ((IParserAccessor)form1).AddParsedSubObject(devSpecific);
    }
    //</Snippet3>
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:Form ID="form1" Runat="server" OnInit="form1_Init">
        <mobile:Panel id="Panel1" Runat="server">
            <mobile:DeviceSpecific Runat="server">
                <Choice Filter="isHTML32">
                    <ContentTemplate>
                        <!-- For HTML Browsers -->
                        <br />
                        <mobile:Label ID="Label3" Runat="server" 
                            Text="Visible in an HTML Browser" />
                        <br />
                    </ContentTemplate>
                </Choice>
                <Choice Filter="isWML11">
                    <ContentTemplate>
                        <!-- For WML Browsers -->
                        <br />
                        <mobile:Label ID="Label4" Runat="server" 
                            Text="Viewable in a WML browser" />
                        <br />
                    </ContentTemplate>
                </Choice>
            </mobile:DeviceSpecific>
        </mobile:Panel>
        <mobile:Label id="Label1" Runat="server" Font-Bold="true" />
        <mobile:Label ID="Label2" Runat="server" Font-Bold="true" />
    </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 Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim count As Integer = Panel1.DeviceSpecific.Choices.Count
        Dim i As Integer
        
        ' Cycle through the DeviceSpecificChoiceCollection.
        For i = 0 To count - 1
            Dim txt1 As String = "Choice {0} has {1} Templates. "
            Dim txt2 As String = "Filter name is '{0}'. "
            
            Label1.Text &= String.Format(txt1, i, _
                Panel1.DeviceSpecific.Choices(i).Templates.Count)
            Label2.Text &= String.Format(txt2, _
                Panel1.DeviceSpecific.Choices(i).Filter)
        Next
    End Sub
    
    '<Snippet3>
    ' Add a DeviceSpecificChoice section programatically
    Protected Sub form1_Init(ByVal sender As Object, ByVal e As EventArgs)
        Dim devSpecific As DeviceSpecific = Panel1.DeviceSpecific
        Dim devChoiceHtml As DeviceSpecificChoice = New DeviceSpecificChoice()
        devChoiceHtml.Filter = "isCHTML10"
        devSpecific.Choices.Add(devChoiceHtml)
        CType(form1, IParserAccessor).AddParsedSubObject(devSpecific)
    End Sub
    '</Snippet3>
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="form1" runat="server">
        <mobile:Panel id="Panel1" Runat="server">
            <mobile:DeviceSpecific ID="DeviceSpecific1" Runat="server">
                <Choice Filter="isHTML32">
                    <ContentTemplate>
                        <!-- For HTML Browsers -->
                        <br />
                        <mobile:Label ID="Label3" Runat="server" 
                            Text="Visible in an HTML Browser" />
                        <br />
                    </ContentTemplate>
                </Choice>
                <Choice Filter="isWML11">
                    <ContentTemplate>
                        <!-- For WML Browsers -->
                        <br />
                        <mobile:Label ID="Label4" Runat="server" 
                            Text="Viewable in a WML browser" />
                        <br />
                    </ContentTemplate>
                </Choice>
            </mobile:DeviceSpecific>
        </mobile:Panel>
        <mobile:Label id="Label1" Runat="server" Font-Bold="true" />
        <mobile:Label ID="Label2" Runat="server" Font-Bold="true" />
    </mobile:form>
</body>
</html>

注釈

オブジェクトの プロパティに Choices アクセスすると、 DeviceSpecific オブジェクトが DeviceSpecificChoiceCollection 取得されます。 このコレクションは、(オブジェクトを ICollection 介して) インターフェイスを ArrayListCollectionBase 実装します。インターフェイスのすべてのプロパティとメソッドを ICollection 実装します。

プロパティ

All
古い.

コレクションから DeviceSpecificChoice オブジェクトの配列を取得します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

Count
古い.

コレクション内の要素の数を返します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)
IsReadOnly
古い.

コレクションが読み取り専用かどうかを示す値を取得します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)
IsSynchronized
古い.

コレクションの同期がとられているかどうかを示す値を取得します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)
Item[Int32]
古い.

コレクション内の DeviceSpecificChoice 項目をインデックスで返します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

Items
古い.

配列一覧オブジェクト内の項目のコレクションを取得または設定します。 既定値は Empty です。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)
SyncRoot
古い.

コレクションの SyncRoot オブジェクトを返します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)

メソッド

Add(DeviceSpecificChoice)
古い.

コレクションの末尾に DeviceSpecificChoice オブジェクトを追加します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

AddAt(Int32, DeviceSpecificChoice)
古い.

index パラメーターによって指定されたコレクション内の位置に選択項目を追加します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

Clear()
古い.

コレクションを空にします。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

CopyTo(Array, Int32)
古い.

コレクション内の項目を、指定されたインデックスから開始して配列にコピーします。 内部でのみ使用されます。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)
Equals(Object)
古い.

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()
古い.

コレクション用の列挙子を取得します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

(継承元 ArrayListCollectionBase)
GetHashCode()
古い.

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()
古い.

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()
古い.

現在の Object の簡易コピーを作成します。

(継承元 Object)
Remove(DeviceSpecificChoice)
古い.

指定された選択項目を削除します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

RemoveAt(Int32)
古い.

指定したインデックス位置にある項目を削除します。 この API は、互換性のために残されています。 ASP.NET モバイル アプリケーションを開発する方法については、「mobile Apps & Sites with ASP.NET」を参照してください。

ToString()
古い.

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

拡張メソッド

Cast<TResult>(IEnumerable)
古い.

IEnumerable の要素を、指定した型にキャストします。

OfType<TResult>(IEnumerable)
古い.

指定された型に基づいて IEnumerable の要素をフィルター処理します。

AsParallel(IEnumerable)
古い.

クエリの並列化を有効にします。

AsQueryable(IEnumerable)
古い.

IEnumerableIQueryable に変換します。

適用対象

こちらもご覧ください