private void ParseNodeToUIComponents(XmlNode Node) { XmlNode tmpNode; string sID; foreach (XmlNode Child in Node.ChildNodes) { switch (Child.Name.ToUpper()) { case "HUSB": sID = Child.Attributes["REF"].Value; tmpNode = GEDXMLUtilites.GlobalLocateNodeByID(sID, "INDI", Child); if (tmpNode != null) { GEDFileEntryIndi Husb = new GEDFileEntryIndi(); Husb.Node = tmpNode; lblHusband.Text = Husb.DisplayName; lblHusband.Tag = sID; } break; case "WIFE": sID = Child.Attributes["REF"].Value; tmpNode = GEDXMLUtilites.GlobalLocateNodeByID(sID, "INDI", Child); if (tmpNode != null) { GEDFileEntryIndi Wife = new GEDFileEntryIndi(); Wife.Node = tmpNode; lblWife.Text = Wife.DisplayName; lblWife.Tag = sID; } break; case "CHIL": sID = Child.Attributes["REF"].Value; tmpNode = GEDXMLUtilites.GlobalLocateNodeByID(sID, "INDI", Child); if (tmpNode != null) { GEDFileEntryIndi Chil = new GEDFileEntryIndi(); Chil.Node = tmpNode; lstChildren.Items.Add(Chil); } break; case "MARR": GEDXMLUtilites.ParseCompoundDate(Child, mdpMarriage); break; case "DIV": GEDXMLUtilites.ParseCompoundDate(Child, mdpDivorce); break; default: break; } } }
private void ParseNodeToUIComponents(XmlNode Node) { XmlNode tmpNode; pictureBox1.Image = pictureBox1.ErrorImage; foreach (XmlNode Child in Node.ChildNodes) { switch (Child.Name.ToUpper()) { case "NAME": txtName.Text = Child.InnerText.Trim(); break; case "SEX": if (Child.InnerText == "M") { rdoMale.Checked = true; } else { rdoFemale.Checked = true; } break; case "BIRT": GEDXMLUtilites.ParseCompoundDate(Child, mdpBirth); break; case "DEAT": GEDXMLUtilites.ParseCompoundDate(Child, mdpDeath); break; case "EVEN": txtAKA.Text = GEDXMLUtilites.ParseText(Child); break; case "IMG": txtImage.Text = Child.InnerText; if (!LoadImage(txtImage.Text)) { txtImage.Text = ""; } break; case "NOTE": Note = Child.InnerText; break; case "SOUR": try { string SourceID = Child.Attributes["REF"].Value; tmpNode = GEDXMLUtilites.GlobalLocateNodeByID(SourceID, "SOUR", Child); if (tmpNode != null) { Source = new GEDFileEntrySour(); Source.Node = tmpNode; lblSource.Text = Source.DisplayName; } } catch (Exception) {} break; case "EMIG": break; case "OCCU": break; default: break; } } }