MobileListItemCollection Klasa

Definicja

Przestroga

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.

Reprezentuje kolekcję MobileListItem obiektów i służy do przechowywania elementów kontrolki List i kontrolki SelectionList . Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

public ref class MobileListItemCollection : System::Web::UI::MobileControls::ArrayListCollectionBase, System::Web::UI::IStateManager
public class MobileListItemCollection : System.Web.UI.MobileControls.ArrayListCollectionBase, System.Web.UI.IStateManager
[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 MobileListItemCollection : System.Web.UI.MobileControls.ArrayListCollectionBase, System.Web.UI.IStateManager
type MobileListItemCollection = class
    inherit ArrayListCollectionBase
    interface IStateManager
[<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 MobileListItemCollection = class
    inherit ArrayListCollectionBase
    interface IStateManager
Public Class MobileListItemCollection
Inherits ArrayListCollectionBase
Implements IStateManager
Dziedziczenie
MobileListItemCollection
Atrybuty
Implementuje

Przykłady

W poniższym przykładzie kodu pokazano, jak manipulować elementami w MobileListItem obiekcie za pomocą MobileListItemCollection klasy. Kod używa indeksu wybranego elementu do SelectionList.Items właściwości.

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

<script runat="server">
    public void Page_Load(Object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Label1.Text = "Select an item";

            // Create and fill an array list.
            ArrayList listValues = new ArrayList();
            listValues.Add("One");
            listValues.Add("Two");
            listValues.Add("Three");

            // Bind the array to the list.
            SelList1.DataSource = listValues;
            SelList1.DataBind();

            // Set the SelectType.
            SelList1.SelectType =
                System.Web.UI.MobileControls.ListSelectType.Radio;
        }
        else
        {
            if (SelList1.SelectedIndex > -1)
            {
                // To show the selection, use the Selection property.
                Label1.Text = "Your selection is " +
                    SelList1.Selection;

                // Or, show the selection by using 
                // the MobileListItemCollection class.
                // Get the index of the selected item
                int idx = SelList1.SelectedIndex;
                Label2.Text = "You have selected " +
                    SelList1.Items[idx].Text;

                // Insert a copy of the selected item
                MobileListItem mi = SelList1.Selection;
                Label3.Text = "The index of your selection is " + 
                    mi.Index.ToString();
                SelList1.Items.Insert(idx, 
                    new MobileListItem(mi.Text + " Copy"));
            }
            else
            {
                Label1.Text = "No items selected";
            }
        }
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="form1" runat="server">
        <mobile:Label id="Label1" runat="server" 
            Text="Show a list" />
        <mobile:Label id="Label2" runat="server" />
        <mobile:Label id="Label3" runat="server" />
        <mobile:SelectionList runat="server" 
            id="SelList1" />
        <mobile:Command id="Command1" runat="server" 
            Text=" OK " />
    </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" %>

<script runat="server">
    Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        If Not IsPostBack Then
            Label1.Text = "Select an item"

            ' Create and fill an array list.
            Dim listValues As New ArrayList()
            listValues.Add("One")
            listValues.Add("Two")
            listValues.Add("Three")

            ' Bind the array to the list.
            SelList1.DataSource = listValues
            SelList1.DataBind()

            ' Set the SelectType.
            SelList1.SelectType = ListSelectType.Radio
        Else
            If (SelList1.SelectedIndex > -1) Then
                ' To show the selection, use the Selection property.
                Label1.Text = "Your selection is " & _
                    SelList1.Selection.Text

                ' Or, show the selection by using 
                ' the MobileListItemCollection class.
                ' Get the index of the selected item
                Dim idx As Integer = SelList1.SelectedIndex
                Label2.Text = "You have selected " & _
                    SelList1.Items(idx).Text

                ' Insert a copy of the selected item
                Dim mi As MobileListItem = SelList1.Selection
                Label3.Text = "The index of your selection is " & _
                    mi.Index.ToString()
                SelList1.Items.Insert(idx, _
                    New MobileListItem(mi.Text + " Copy"))
            Else
                Label1.Text = "No items selected"
            End If
        End If
    End Sub
</script>

<html xmlns="http:'www.w3.org/1999/xhtml" >
<body>
    <mobile:form id="form1" runat="server">
        <mobile:Label id="Label1" runat="server" 
            Text="Show a list" />
        <mobile:Label id="Label2" runat="server" />
        <mobile:Label id="Label3" runat="server" />
        <mobile:SelectionList runat="server" 
            id="SelList1" />
        <mobile:Command id="Command1" runat="server" 
            Text=" OK " />
    </mobile:form>
</body>
</html>

Uwagi

Uzyskiwanie Items dostępu do właściwości kontrolki List lub Items właściwości SelectionList kontrolki pobiera MobileListItemCollection obiekt. Możesz dodawać lub usuwać elementy z kolekcji w czasie wykonywania.

Obiekt MobileListItemCollection dziedziczy z interfejsu ICollection .

Konstruktory

MobileListItemCollection()
Przestarzałe.

Inicjuje nowe wystąpienie klasy MobileListItemCollection. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

MobileListItemCollection(ArrayList)
Przestarzałe.

Inicjuje MobileListItemCollection nowe wystąpienie klasy przy użyciu podanej tablicy. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Właściwości

Count
Przestarzałe.

Zwraca liczbę elementów w kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET). Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)
IsReadOnly
Przestarzałe.

Pobiera wartość wskazującą, czy kolekcja jest tylko do odczytu. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET). Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)
IsSynchronized
Przestarzałe.

Pobiera wartość wskazującą, czy kolekcja jest zsynchronizowana. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET). Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)
IsTrackingViewState
Przestarzałe.

Pobiera wartość wskazującą, czy kolekcja śledzi zmiany stanu widoku. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Item[Int32]
Przestarzałe.

MobileListItem Pobiera element w kolekcji według indeksu. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Items
Przestarzałe.

Pobiera lub ustawia kolekcję elementów w obiekcie listy tablicy. Wartość domyślna to Empty. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)
SyncRoot
Przestarzałe.

Zwraca obiekt SyncRoot dla kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)

Metody

Add(MobileListItem)
Przestarzałe.

Dodaje element na końcu kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Add(String)
Przestarzałe.

Dodaje element na końcu kolekcji z podanym ciągiem jako właściwością Text . Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Clear()
Przestarzałe.

Czyści kolekcję. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Contains(MobileListItem)
Przestarzałe.

Pobiera wartość wskazującą, czy dany element jest zawarty w kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

CopyTo(Array, Int32)
Przestarzałe.

Kopiuje elementy w kolekcji do tablicy, zaczynając od danego indeksu. Przeznaczone tylko do użytku wewnętrznego. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET). Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)
Equals(Object)
Przestarzałe.

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetAll()
Przestarzałe.

Pobiera elementy w określonej kolekcji jako pojedynczą tablicę MobileListItem obiektów. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

GetEnumerator()
Przestarzałe.

Pobiera moduł wyliczający dla kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET). Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

(Odziedziczone po ArrayListCollectionBase)
GetHashCode()
Przestarzałe.

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()
Przestarzałe.

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
IndexOf(MobileListItem)
Przestarzałe.

Pobiera indeks określonego elementu w MobileListItemCollection obiekcie. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Insert(Int32, MobileListItem)
Przestarzałe.

Dodaje element do określonej lokalizacji w kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Insert(Int32, String)
Przestarzałe.

Dodaje element do określonej lokalizacji w kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

LoadViewState(Object)
Przestarzałe.

Ładuje wcześniej zapisany stan widoku kolekcji. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

MemberwiseClone()
Przestarzałe.

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
Remove(MobileListItem)
Przestarzałe.

Usuwa element z określoną wartością. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

Remove(String)
Przestarzałe.

Usuwa element z określoną wartością. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

RemoveAt(Int32)
Przestarzałe.

Usuwa element pod określonym indeksem. Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

SaveViewState()
Przestarzałe.

Zapisuje zmiany w stanie widoku kontrolki serwera w obiekcie Object. Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

SetAll(MobileListItem[])
Przestarzałe.

Ustawia tablicę MobileListItem obiektów jako MobileListItemCollection. Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

ToString()
Przestarzałe.

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)
TrackViewState()
Przestarzałe.

Instruuje kolekcję, aby śledzić zmiany w stanie widoku. Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

Jawne implementacje interfejsu

IStateManager.IsTrackingViewState
Przestarzałe.

Aby uzyskać opis tego elementu członkowskiego, zobacz IsTrackingViewState. Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

IStateManager.LoadViewState(Object)
Przestarzałe.

Aby uzyskać opis tego elementu członkowskiego, zobacz LoadViewState(Object). Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

IStateManager.SaveViewState()
Przestarzałe.

Aby uzyskać opis tego elementu członkowskiego, zobacz SaveViewState(). Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

IStateManager.TrackViewState()
Przestarzałe.

Aby uzyskać opis tego elementu członkowskiego, zobacz TrackViewState(). Ten interfejs API jest nieaktualny. Aby uzyskać informacje o sposobie tworzenia aplikacji mobilnych ASP.NET, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & z ASP.NET).

Metody rozszerzania

Cast<TResult>(IEnumerable)
Przestarzałe.

Rzutuje elementy obiektu IEnumerable na określony typ.

OfType<TResult>(IEnumerable)
Przestarzałe.

Filtruje elementy IEnumerable elementu na podstawie określonego typu.

AsParallel(IEnumerable)
Przestarzałe.

Umożliwia równoległość zapytania.

AsQueryable(IEnumerable)
Przestarzałe.

Konwertuje element IEnumerable na .IQueryable

Dotyczy

Zobacz też