public override bool Accept() { try { fEvent.Place.StringValue = fView.Place.Text; fEvent.Place.Location.Value = fTempLocation; fEvent.Classification = fView.EventName.Text; fEvent.Cause = fView.Cause.Text; fEvent.Agency = fView.Agency.Text; GDMCustomDate dt = AssembleDate(); if (dt == null) { throw new ArgumentNullException("dt"); } fEvent.Date.ParseString(dt.StringValue); int eventType = fView.EventType.SelectedIndex; if (fEvent is GDMFamilyEvent) { fEvent.SetName(GKData.FamilyEvents[eventType].Sign); } else { GKData.EventStruct eventProps = GKData.PersonEvents[eventType]; fEvent.SetName(eventProps.Sign); if (eventProps.Kind == PersonEventKind.ekFact) { fEvent.StringValue = fView.Attribute.Text; } else { fEvent.StringValue = ""; } } if (fEvent is GDMIndividualEvent) { if (GKData.PersonEvents[eventType].Kind == PersonEventKind.ekFact) { GDMIndividualAttribute attr = new GDMIndividualAttribute(fEvent.Owner); attr.Assign(fEvent); fEvent = attr; } } CommitChanges(); return(true); } catch (Exception ex) { Logger.WriteError("EventEditController.Accept()", ex); return(false); } }
private static void CheckIndividualEvent(GDMCustomEvent evt, GEDCOMFormat format) { // Fix for Family Tree Maker 2008 which exports occupation as generic EVEN events if (format == GEDCOMFormat.gf_FamilyTreeMaker) { string subtype = evt.Classification.ToLower(); if (evt.Id == (int)GEDCOMTagType.EVEN && subtype == "occupation") { evt.SetName(GEDCOMTagType.OCCU); evt.Classification = string.Empty; } } }
private void CheckEvent(GDMCustomEvent evt) { CheckStructWL(evt); // Fix for Family Tree Maker 2008 which exports occupation as generic EVEN events if (fFormat == GEDCOMFormat.gf_FamilyTreeMaker) { string subtype = evt.Classification.ToLower(); if (evt.Id == (int)GEDCOMTagType.EVEN && subtype == "occupation") { evt.SetName(GEDCOMTagType.OCCU); evt.Classification = string.Empty; } } CheckEventPlace(evt.Place); }