ListCommandEventArgs クラス
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)


ListCommandEventArgs オブジェクトを使用して、項目がクリックされたときにリスト内のタスクのステータスを変更する方法を次のコード例に示します。このコード例は、List の概要で取り上げているコード例の一部です。
![]() |
---|
次のコード サンプルはシングルファイル コード モデルを使用しており、分離コード ファイルに直接コピーされた場合は正常に動作しない可能性があります。このコード サンプルは、拡張子が .aspx の空のテキスト ファイルにコピーする必要があります。詳細については、「ASP.NET Web ページのコード モデル」を参照してください。 |
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
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


System.EventArgs
System.Web.UI.WebControls.CommandEventArgs
System.Web.UI.MobileControls.ListCommandEventArgs


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ListCommandEventArgs コンストラクタ (MobileListItem, Object)
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)

Dim item As MobileListItem Dim commandSource As Object Dim instance As New ListCommandEventArgs(item, commandSource)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ListCommandEventArgs コンストラクタ

名前 | 説明 |
---|---|
ListCommandEventArgs (MobileListItem, Object) | 指定した ListItem と CommandSource を使用して、ListCommandEventArgs クラスの新しいインスタンスを初期化します。 |
ListCommandEventArgs (MobileListItem, Object, CommandEventArgs) | 指定した ListItem、CommandSource、および元のコマンド引数を使用して、ListCommandEventArgs クラスの新しいインスタンスを初期化します。 |

ListCommandEventArgs コンストラクタ (MobileListItem, Object, CommandEventArgs)
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)

Public Sub New ( _ item As MobileListItem, _ commandSource As Object, _ originalArgs As CommandEventArgs _ )
Dim item As MobileListItem Dim commandSource As Object Dim originalArgs As CommandEventArgs Dim instance As New ListCommandEventArgs(item, commandSource, originalArgs)
public ListCommandEventArgs ( MobileListItem item, Object commandSource, CommandEventArgs originalArgs )
public: ListCommandEventArgs ( MobileListItem^ item, Object^ commandSource, CommandEventArgs^ originalArgs )
public ListCommandEventArgs ( MobileListItem item, Object commandSource, CommandEventArgs originalArgs )
public function ListCommandEventArgs ( item : MobileListItem, commandSource : Object, originalArgs : CommandEventArgs )

このコンストラクタは、ListCommandEventArgs オブジェクトを構築します。
ListItem プロパティと CommandSource プロパティは、item パラメータと commandSource パラメータの値でそれぞれ初期化されます。このコンストラクタには originalArgs パラメータがあります。この形式のコンストラクタでは、originalArgs パラメータを通じて一連のコマンド引数の受け渡しが可能です。バブル イベントを処理する場合に役立ちます。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ListCommandEventArgs フィールド
ListCommandEventArgs プロパティ

名前 | 説明 | |
---|---|---|
![]() | CommandArgument | コマンドの引数を取得します。 ( CommandEventArgs から継承されます。) |
![]() | CommandName | コマンド名を取得します。 ( CommandEventArgs から継承されます。) |
![]() | CommandSource | イベントの発生元のコントロールを返します。 |
![]() | ListItem | イベントを生成したリスト項目を返します。 |

ListCommandEventArgs メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

ListCommandEventArgs メンバ
List コントロールの ItemCommand イベントのデータを提供します。
ListCommandEventArgs データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | CommandArgument | コマンドの引数を取得します。(CommandEventArgs から継承されます。) |
![]() | CommandName | コマンド名を取得します。(CommandEventArgs から継承されます。) |
![]() | CommandSource | イベントの発生元のコントロールを返します。 |
![]() | ListItem | イベントを生成したリスト項目を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- ListCommandEventArgsのページへのリンク