Esempio n. 1
0
        private async void btnScan_Click(object sender, RoutedEventArgs e)
        {
            if (tswOnline.IsOn && await isLoggedIn())
            {
                wvScanner.Source = new Uri("https://robertsspaceindustries.com/account/buy-back-pledges?page=1&pagesize=100");
            }
            else if (!tswOnline.IsOn)
            {
                HtmlDocument Document = new HtmlDocument();
                Document.LoadHtml(tbScanner.Text);
                Scan newScan = new Scan();

                var dialog = new MessageDialog($"Found {newScan.AddPledges(Document).ToString()} Pledges on Account {newScan.Account}");

                try
                {
                    App.Scans.Find(a => a.Account == newScan.Account).Pledges.AddRange(newScan.Pledges);
                }
                catch
                {
                    App.Scans.Add(newScan);
                }

                await dialog.ShowAsync();
            }
        }