System.ComponentModel.BackgroundWorker.RunWorkerAsync C# (CSharp) Method

RunWorkerAsync() public method

public RunWorkerAsync ( ) : void
return void
        public void RunWorkerAsync()
        {
            RunWorkerAsync(null);
        }

Same methods

BackgroundWorker::RunWorkerAsync ( object argument ) : void

Usage Example

Example #1
1
 public static void ParseRecommends(string html, Action<List<Recommend>> finished)
 {
     BackgroundWorker bw = new BackgroundWorker();
     bw.DoWork += new DoWorkEventHandler((sender, e) =>
     {
         List<Recommend> allRecommends = new List<Recommend>();
         HtmlDocument hDoc = new HtmlDocument();
         hDoc.LoadHtml(html);
         var tableRows = hDoc.DocumentNode.SelectNodes(Constants.Instance.XPATH_GAME_SHOW_RESULT);
         foreach (var node in tableRows)
         {
             var results = ChildElementsInTableRow(node);
             if (results.Count == Constants.Instance.COUNT_GAME_SHOW_RESULT_COLUMNS)
             {
                 var rec = RecommendFromStrings(results);
                 if (IsValidRecommend(rec))
                 {
                     allRecommends.Add(rec);
                 }
             }
         }
         finished(allRecommends);
     });
     bw.RunWorkerAsync();
 }
All Usage Examples Of System.ComponentModel.BackgroundWorker::RunWorkerAsync