IndividualEventClass DecodeEventType(string eventString, IndividualEventClass.EventType evType, bool note)
        {
            IndividualEventClass ev = new IndividualEventClass(evType);
            FamilyDateTimeClass  date;
            string tempString = eventString;

            date = ParseDateString(ref tempString);
            if (date != null)
            {
                ev.SetDate(date);
            }
            if (tempString.Length > 0)
            {
                if (note)
                {
                    ev.AddNote(new NoteClass(tempString));
                }
                else
                {
                    AddressClass address = new AddressClass();
                    address.AddAddressPart(AddressPartClass.AddressPartType.StreetAddress, tempString);
                    ev.AddAddress(address);
                }
            }
            trace.TraceInformation(evType + ":" + eventString + " => " + tempString + " " + ev);
            return(ev);
        }
 public IList <IndividualEventClass> GetEventList(IndividualEventClass.EventType requestedEventTypes = IndividualEventClass.EventType.AllEvents)
 {
     if (eventList == null)
     {
         return(new List <IndividualEventClass>());
     }
     return(eventList);
 }
 public void AddEvent(IndividualEventClass.EventType eventType, FamilyDateTimeClass date)
 {
     trace.TraceInformation("IndividualClass.SetDate(" + eventType + "," + date + ")");
     if (eventList == null)
     {
         eventList = new List <IndividualEventClass>();
     }
     eventList.Add(new IndividualEventClass(eventType, date));
 }
Example #4
0
        public void AddEvent(IndividualEventClass.EventType eventType, FamilyDateTimeClass date)
        {
            IndividualEventClass tempEvent = new IndividualEventClass();

            tempEvent.SetEventType(eventType);
            tempEvent.SetDate(date);

            if (familyEventList == null)
            {
                familyEventList = new List <IndividualEventClass>();
            }
            familyEventList.Add(tempEvent);
        }
 public IndividualEventClass GetEvent(IndividualEventClass.EventType requestedEventType)
 {
     if (eventList != null)
     {
         foreach (IndividualEventClass ev in eventList)
         {
             if (ev.GetEventType() == requestedEventType)
             {
                 return(ev);
             }
         }
     }
     return(null);
 }
        public FamilyDateTimeClass GetDate(IndividualEventClass.EventType eventType)
        {
            //trace.TraceInformation("IndividualClass.GetDate(" + eventType + ")");

            if (eventList != null)
            {
                foreach (IndividualEventClass individualEvent in eventList)
                {
                    if (individualEvent.GetEventType() == eventType)
                    {
                        return(individualEvent.GetDate());
                    }
                }
            }
            return(new FamilyDateTimeClass());
        }
        string GetEventDateString(IndividualClass person, IndividualEventClass.EventType evType)
        {
            if (person != null)
            {
                IndividualEventClass ev = person.GetEvent(IndividualEventClass.EventType.Birth);

                if (ev != null)
                {
                    FamilyDateTimeClass date = ev.GetDate();

                    if (date != null)
                    {
                        return(date.ToString());
                    }
                }
            }
            return("");
        }
 public IList <IndividualEventClass> GetEventList(IndividualEventClass.EventType requestedEventTypes = IndividualEventClass.EventType.AllEvents)
 {
     return(eventList);
 }