/// <summary> /// Add a new family event for a given event type. /// </summary> /// <param name="type">The event type.</param> /// <returns> /// The new family event based on the given event type. /// </returns> public GedcomFamilyEvent AddNewEvent(GedcomEventType type) { GedcomFamilyEvent familyEvent = new GedcomFamilyEvent(); familyEvent.EventType = type; familyEvent.Level = Level + 1; familyEvent.FamRecord = this; Events.Add(familyEvent); return(familyEvent); }
/// <summary> /// Attempts to determine a standard event type from a textual /// description. Always returns GenericEvent if one can't be found /// even though where the string came from maybe a FACT /// </summary> /// <param name="readable">The type name as a string.</param> /// <returns> /// A GedcomEventType matching the textual description, or GenericEvent if no match was found. /// </returns> public static GedcomEventType ReadableToType(string readable) { GedcomEventType ret = GedcomEventType.GenericEvent; int i = typeDescriptions.IndexOf(readable); if (i != -1) { ret = (GedcomEventType)i; } return(ret); }
private GedcomIndividualEvent CreateEvent(GedcomEventType eventType, string dateText, string placeName) { var ev = new GedcomIndividualEvent { EventType = eventType, Date = new GedcomDate(gedcomDb) }; ev.Date.ParseDateString(dateText); ev.Place = new GedcomPlace { Name = placeName }; return(ev); }
/// <summary> /// Get the tag for a GedcomEventType. /// </summary> /// <param name="eventType">A GEDCOM event type.</param> /// <returns> /// The tag for a given GedcomEventType. /// </returns> public static string TypeToTag(GedcomEventType eventType) { return(typeStrings[(int)eventType]); }
/// <summary> /// Get the user-friendly textual description for a GedcomEventType. /// </summary> /// <param name="eventType">A GEDCOM event type.</param> /// <returns> /// The textual description for a given GedcomEventType. /// </returns> public static string TypeToReadable(GedcomEventType eventType) { return(typeDescriptions[(int)eventType]); }
public static string TypeToReadable(GedcomEventType eventType) { return TypeDescriptions[(int)eventType]; }
public static string TypeToTag(GedcomEventType eventType) { return TypeStrings[(int)eventType]; }