async partial void LostCousinsUpdateClicked(NSObject sender)
        {
            LostCousinsUpdateButton.Enabled = false;
            if (LCUpdates?.Count > 0)
            {
                UpdateResultsTextbox.Value = string.Empty;
                int response = UIHelpers.ShowYesNo($"You have {LCUpdates.Count} possible records to add to Lost Cousins. Proceed?");
                if (response == UIHelpers.Yes)
                {
                    UpdateResultsTextbox.Value = "Started Processing Lost Cousins entries.\n\n";
                    Progress <string> outputText = new Progress <string>(AppendMessage);
                    int count = await Task.Run(() => ExportToLostCousins.ProcessList(LCUpdates, outputText));

                    string resultText = $"{DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm")}: uploaded {count} records";
                    await Analytics.TrackActionAsync(Analytics.LostCousinsAction, Analytics.UpdateLostCousins, resultText);

                    SpecialMethods.VisitWebsite("https://www.lostcousins.com/pages/members/ancestors/");
                    UpdateLostCousinsReport();
                    LCReport.UpdateLostCousinsReport(ProgressController);
                }
            }
            else
            {
                UIHelpers.ShowMessage("You have no records to add to Lost Cousins at this time. Use the Research Suggestions to find more people on the census, or enter/update missing or incomplete census references.");
            }
            LostCousinsUpdateButton.Enabled = true;
        }
Exemple #2
0
 void UpdateLostCousinsReport(ProgressController progressController)
 {
     Task.Run(() =>
     {
         progressController.ProgressText = "Loading Census Statistics";
         progressController.ProgressBar  = 0;
         InvokeOnMainThread(() => progressController.ShowWindow(this));
         lCReportsViewController.UpdateLostCousinsReport(progressController);
         progressController.ProgressBar  = 50;
         progressController.ProgressText = "Loading Lost Cousins Statistics";
         lCUpdatesViewController.UpdateLostCousinsReport(lCReportsViewController.RelationshipTypes, progressController, lCReportsViewController);
         progressController.ProgressBar = 100;
         InvokeOnMainThread(progressController.Close);
     });
     if (GeneralSettings.Default.SkipCensusReferences)
     {
         UIHelpers.ShowMessage("Option to skip Census reference is set. No data can be uploaded to Lost Cousins without a Census Reference.");
     }
 }