DoWorkEventArgs.Argument プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DoWorkEventArgs.Argument プロパティの意味・解説 

DoWorkEventArgs.Argument プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

非同期操作引数を表す値を取得します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

使用例使用例

DoWorkEventArgs クラス使用して DoWork イベント処理する方法を示すコード例次に示します。完全なコードの一覧については、「方法 : バックグラウンド操作実行する」を参照してください

Private Sub backgroundWorker1_DoWork( _
sender As Object, e As DoWorkEventArgs)
 _
Handles backgroundWorker1.DoWork

   ' Do not access the form's BackgroundWorker reference directly.
   ' Instead, use the reference provided by the sender parameter.
   Dim bw As BackgroundWorker = CType( sender,
 BackgroundWorker )
   
   ' Extract the argument.
   Dim arg As Integer =
 Fix(e.Argument)
   
   ' Start the time-consuming operation.
   e.Result = TimeConsumingOperation(bw, arg)
   
   ' If the operation was canceled by the user, 
   ' set the DoWorkEventArgs.Cancel property to true.
   If bw.CancellationPending Then
      e.Cancel = True
   End If

End Sub   
private void backgroundWorker1_DoWork(object
 sender, DoWorkEventArgs e)
{
    // Do not access the form's BackgroundWorker reference directly.
    // Instead, use the reference provided by the sender parameter.
    BackgroundWorker bw = sender as BackgroundWorker;

    // Extract the argument.
    int arg = (int)e.Argument;

    // Start the time-consuming operation.
    e.Result = TimeConsumingOperation(bw, arg);

    // If the operation was canceled by the user, 
    // set the DoWorkEventArgs.Cancel property to true.
    if (bw.CancellationPending)
    {
        e.Cancel = true;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DoWorkEventArgs.Argument プロパティ」の関連用語

DoWorkEventArgs.Argument プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DoWorkEventArgs.Argument プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS