// private const int _MATCHES_LIMIT_ = 100; public HTML_Parser() { PageData = new PageDataStruct(); MatchData = new List <MatchDataStruct>(); PageData.ScoredAndConceded = new string[4]; InitializeStructure(); }
/* ============================================================================================================================ */ private void Button_Start_Click(object sender, RoutedEventArgs e) { PageDataStruct fullStruct = Parser.GetLinksStruct; List <string> linksLust = fullStruct.MatchLink; if (ParseOdds) { Parser.InitializeJSDriver(); } FlyOut_FindingMatches.Header = "Finding matches to bet, please wait..."; FlyOut_FindingMatches.Visibility = Visibility.Visible; ProgressBar_.Visibility = Visibility.Visible; BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (callbackSender, callbackEvent) => { foreach (string lnk in linksLust) { if (lnk != null) { //Thread th = new Thread(() => AccessPage(lnk)); //Parser.ProcessMatchesPage(lnk); Thread th = new Thread(() => Parser.ProcessMatchesPage(lnk)); th.Start(); Thread.Sleep(200); } } }; bw.RunWorkerCompleted += (sender2, e2) => { FlyOut_FindingMatches.Visibility = Visibility.Collapsed; ProgressBar_.Visibility = Visibility.Collapsed; string x = (Assembly.GetEntryAssembly().Location + ""); x = x.Replace("Soccer.exe", @"sounds\sound.wav"); x = x.Replace(@"\bin\Debug", ""); SoundPlayer player = new SoundPlayer(); player.SoundLocation = x; player.Play(); }; bw.RunWorkerAsync(); //t.Start(); }