public override GEDCOMTag AddTag(string tagName, string tagValue, TagConstructor tagConstructor)
        {
            GEDCOMTag result;

            if (tagName == "HUSB" || tagName == "WIFE")
            {
                result = base.AddTag(tagName, tagValue, GEDCOMPointer.Create);
            }
            else if (tagName == "CHIL")
            {
                result = fChildren.Add(new GEDCOMPointer(Owner, this, tagName, tagValue));
            }
            else
            {
                result = fTagsFactory.CreateTag(Owner, this, tagName, tagValue);

                if (result != null)
                {
                    if (result is GEDCOMFamilyEvent)
                    {
                        result = AddEvent(result as GEDCOMFamilyEvent);
                    }
                    else if (result is GEDCOMSpouseSealing)
                    {
                        result = fSpouseSealings.Add(result as GEDCOMSpouseSealing);
                    }
                }
                else
                {
                    result = base.AddTag(tagName, tagValue, tagConstructor);
                }
            }

            return(result);
        }
示例#2
0
        public override GEDCOMTag AddTag(string tagName, string tagValue, TagConstructor tagConstructor)
        {
            GEDCOMTag result;

            if (tagName == "NAME")
            {
                result = AddPersonalName(new GEDCOMPersonalName(Owner, this, tagName, tagValue));
            }
            else if (tagName == "SUBM")
            {
                result = Submittors.Add(new GEDCOMPointer(Owner, this, tagName, tagValue));
            }
            else if (tagName == "ANCI")
            {
                result = AncestorsInterest.Add(new GEDCOMPointer(Owner, this, tagName, tagValue));
            }
            else if (tagName == "DESI")
            {
                result = DescendantsInterest.Add(new GEDCOMPointer(Owner, this, tagName, tagValue));
            }
            else if (tagName == "_GROUP")
            {
                result = fGroups.Add(new GEDCOMPointer(Owner, this, tagName, tagValue));
            }
            else
            {
                result = fTagsFactory.CreateTag(Owner, this, tagName, tagValue);

                if (result != null)
                {
                    if (result is GEDCOMChildToFamilyLink)
                    {
                        result = ChildToFamilyLinks.Add(result as GEDCOMChildToFamilyLink);
                    }
                    else if (result is GEDCOMSpouseToFamilyLink)
                    {
                        result = SpouseToFamilyLinks.Add(result as GEDCOMSpouseToFamilyLink);
                    }
                    else if (result is GEDCOMIndividualOrdinance)
                    {
                        result = IndividualOrdinances.Add(result as GEDCOMIndividualOrdinance);
                    }
                    else if (result is GEDCOMAssociation)
                    {
                        result = Associations.Add(result as GEDCOMAssociation);
                    }
                    else if (result is GEDCOMIndividualEvent)
                    {
                        result = AddEvent(result as GEDCOMCustomEvent);
                    }
                    else if (result is GEDCOMIndividualAttribute)
                    {
                        result = AddEvent(result as GEDCOMCustomEvent);
                    }
                    else if (result is GEDCOMAlias)
                    {
                        result = Aliases.Add(result as GEDCOMAlias);
                    }
                }
                else
                {
                    result = base.AddTag(tagName, tagValue, tagConstructor);
                }
            }

            return(result);
        }