ListCommandEventArgs 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.

Dostarcza dane dla ItemCommand zdarzenia kontrolki List . Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps & Sites with ASP.NET (Aplikacje mobilne & Sites with ASP.NET).

public ref class ListCommandEventArgs : System::Web::UI::WebControls::CommandEventArgs
public class ListCommandEventArgs : System.Web.UI.WebControls.CommandEventArgs
[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 ListCommandEventArgs : System.Web.UI.WebControls.CommandEventArgs
type ListCommandEventArgs = class
    inherit CommandEventArgs
[<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 ListCommandEventArgs = class
    inherit CommandEventArgs
Public Class ListCommandEventArgs
Inherits CommandEventArgs
Dziedziczenie
ListCommandEventArgs
Atrybuty

Przykłady

Poniższy przykład kodu pokazuje, jak można użyć ListCommandEventArgs obiektu w celu zmodyfikowania stanu zadań na liście po kliknięciu elementu. Ten przykład jest częścią większego przykładu dla List omówienia.

Uwaga

Poniższy przykładowy kod używa modelu kodu z jednym plikiem i może nie działać poprawnie, jeśli został skopiowany bezpośrednio do pliku za pomocą kodu. Ten przykładowy kod musi zostać skopiowany do pustego pliku tekstowego z rozszerzeniem aspx. Aby uzyskać więcej informacji, zobacz model kodu strony ASP.NET Web Forms.

private void Status_ItemCommand(object sender, 
    ListCommandEventArgs e)
{
    const string spec = "You now have {0} " + 
        "tasks done, {1} tasks scheduled, and " +
        "{2} tasks pending.";

    // Move selection to next status toward 'done'
    switch (e.ListItem.Value)
    {
        case "scheduled":
            schedCount -= 1;
            pendCount += 1;
            e.ListItem.Value = "pending";
            break;
        case "pending":
            pendCount -= 1;
            doneCount += 1;
            e.ListItem.Value = "done";
            break;
    }

    // Show the status of the current task
    Label1.Text = e.ListItem.Text + " is " +
        e.ListItem.Value;

    // Show current selection counts
    Label2.Text = String.Format(spec, doneCount, 
        schedCount, pendCount);
}
Private Sub Status_ItemCommand(ByVal sender As Object, _
    ByVal e As ListCommandEventArgs)

    Const spec As String = "You now have {0} tasks done, {1} " & _
        "tasks scheduled, and {2} tasks pending."

    ' Move selection to next status toward 'done'
    Select Case e.ListItem.Value
        Case "scheduled"
            schedCount -= 1
            pendCount += 1
            e.ListItem.Value = "pending"
        Case "pending"
            pendCount -= 1
            doneCount += 1
            e.ListItem.Value = "done"
            
    End Select

    ' Show the status of the current task
    Label1.Text = e.ListItem.Text & " is " & _
        e.ListItem.Value

    ' Show current selection counts
    Label2.Text = String.Format(spec, doneCount, _
        schedCount, pendCount)
End Sub

Konstruktory

ListCommandEventArgs(MobileListItem, Object)
Przestarzałe.

Inicjuje ListCommandEventArgs nowe wystąpienie klasy przy użyciu podanych ListItem elementów i CommandSource. 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).

ListCommandEventArgs(MobileListItem, Object, CommandEventArgs)
Przestarzałe.

Inicjuje nowe wystąpienie ListCommandEventArgs klasy przy użyciu podanych ListItemargumentów , CommandSourcei oryginalnych argumentów polecenia. 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).

Pola

DefaultCommand
Przestarzałe.

Ustawia lub zwraca nazwę domyślnego polecenia. 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

CommandArgument
Przestarzałe.

Pobiera argument polecenia .

(Odziedziczone po CommandEventArgs)
CommandName
Przestarzałe.

Pobiera nazwę polecenia.

(Odziedziczone po CommandEventArgs)
CommandSource
Przestarzałe.

Zwraca kontrolkę, która wywołała zdarzenie. 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).

ListItem
Przestarzałe.

Zwraca element listy, który wygenerował zdarzenie. 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).

Metody

Equals(Object)
Przestarzałe.

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

(Odziedziczone po Object)
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)
MemberwiseClone()
Przestarzałe.

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

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

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

(Odziedziczone po Object)

Dotyczy

Zobacz też