void Form1_LoadGed(object sender, EventArgs e) { gedtrees = new Forest(); // TODO Using LastFile is a hack... pass path in args? not as event? gedtrees.LoadGEDCOM(LastFile); DateEstimator.Estimate(gedtrees); // TODO people should be distinguished by date range [as seen on tamurajones.net... where?] HashSet <string> comboNames = new HashSet <string>(); foreach (var indiId in gedtrees.AllIndiIds) { Person p = gedtrees.PersonById(indiId); //// for each person, show the # of individuals available in (first) pedigree //Pedigrees pd = new Pedigrees(p, firstOnly: true); //p.Ahnen = pd.GetPedigreeMax(0); //var text = string.Format("{0} [{1}] ({2})", p.Name, indiId, p.Ahnen); var text = string.Format("{0} [{1}]", p.Name, indiId); comboNames.Add(text); _cmbItems.Add(new { Text = text, Value = p }); } personSel.DisplayMember = "Text"; personSel.ValueMember = "Value"; personSel.DataSource = _cmbItems; personSel.Enabled = true; }
private Forest Load(string txt) { Forest f = LoadGEDFromStream(txt); Assert.AreEqual(0, f.ErrorsCount); Assert.AreEqual(0, f.Errors.Count); DateEstimator.Estimate(f); return(f); }
public void Empty() { var txt = ""; Forest f = LoadGEDFromStream(txt); Assert.AreEqual(0, f.ErrorsCount); Assert.AreEqual(1, f.Errors.Count); DateEstimator.Estimate(f); }
void Form1_LoadGed(object sender, EventArgs e) { gedtrees = new Forest(); gedtrees.LoadGEDCOM(LastFile); DateEstimator.Estimate(gedtrees); foreach (var union in gedtrees.AllUnions) { var text = union.Id; // TODO add spouse names _cmbItems.Add(new { Text = text, Value = union }); } cmbFamilies.DisplayMember = "Text"; cmbFamilies.ValueMember = "Value"; cmbFamilies.DataSource = _cmbItems; cmbFamilies.SelectedIndex = 0; cmbFamilies.Enabled = rbFamGroup.Checked; // populate combobox with individuals // www.ahnenbuch.de-AMMON has multiple individuals with the same name. Need to distinguish // them somehow for the combobox. // TODO is there a better way? unique thing for combobox selection? HashSet <string> comboNames = new HashSet <string>(); foreach (var indiId in gedtrees.AllIndiIds) { Person p = gedtrees.PersonById(indiId); // for each person, show the # of individuals available in (first) pedigree Pedigrees pd = new Pedigrees(p, firstOnly: true); p.Ahnen = pd.GetPedigreeMax(0); var text = string.Format("{0} [{1}] ({2})", p.Name, indiId, p.Ahnen); comboNames.Add(text); _cmbPedItems.Add(new { Text = text, Value = p }); } cmbPerson.DisplayMember = "Text"; cmbPerson.ValueMember = "Value"; cmbPerson.DataSource = _cmbPedItems; cmbPerson.SelectedIndex = 0; cmbPerson.Enabled = !rbFamGroup.Checked; }