Example #1
0
        /// <summary>
        /// Adding nested sub-tags.
        /// </summary>
        /// <param name="tagName">A name of sub-tag.</param>
        /// <param name="tagValue">A string value of sub-tag.</param>
        /// <param name="tagConstructor">The default constructor of sub-tag.</param>
        /// <returns></returns>
        public virtual GEDCOMTag AddTag(string tagName, string tagValue, TagConstructor tagConstructor)
        {
            GEDCOMTag tag = null;

            try
            {
                if (tagConstructor != null)
                {
                    tag = tagConstructor(fOwner, this, tagName, tagValue);
                }
                else
                {
                    tag = GEDCOMFactory.GetInstance().CreateTag(fOwner, this, tagName, tagValue);
                    if (tag == null)
                    {
                        tag = new GEDCOMTag(fOwner, this, tagName, tagValue);
                    }
                }

                InsertTag(tag);
            }
            catch (Exception ex)
            {
                Logger.LogWrite("GEDCOMTag.AddTag(): " + ex.Message);
            }
            return(tag);
        }
Example #2
0
 public static GEDCOMFactory GetInstance()
 {
     if (fInstance == null)
     {
         fInstance = new GEDCOMFactory();
     }
     return(fInstance);
 }
Example #3
0
        static GEDCOMTree()
        {
            GEDCOMFactory f = GEDCOMFactory.GetInstance();

            f.RegisterTag("DATE", GEDCOMDateValue.Create);
            f.RegisterTag("TIME", GEDCOMTime.Create);
            f.RegisterTag("ADDR", GEDCOMAddress.Create);
            f.RegisterTag("PLAC", GEDCOMPlace.Create);
            f.RegisterTag("MAP", GEDCOMMap.Create);
            f.RegisterTag("_LOC", GEDCOMPointer.Create);
            f.RegisterTag("_POSITION", GEDCOMCutoutPosition.Create);
            f.RegisterTag("LANG", GEDCOMLanguage.Create);
            f.RegisterTag("FAMC", GEDCOMPointer.Create);
        }
        static GEDCOMFamilyRecord()
        {
            GEDCOMFactory f = new GEDCOMFactory();

            fTagsFactory = f;

            f.RegisterTag("SLGS", GEDCOMSpouseSealing.Create);

            f.RegisterTag("ANUL", GEDCOMFamilyEvent.Create);
            f.RegisterTag("CENS", GEDCOMFamilyEvent.Create);
            f.RegisterTag("DIV", GEDCOMFamilyEvent.Create);
            f.RegisterTag("DIVF", GEDCOMFamilyEvent.Create);
            f.RegisterTag("ENGA", GEDCOMFamilyEvent.Create);
            f.RegisterTag("MARB", GEDCOMFamilyEvent.Create);
            f.RegisterTag("MARC", GEDCOMFamilyEvent.Create);
            f.RegisterTag("MARR", GEDCOMFamilyEvent.Create);
            f.RegisterTag("MARL", GEDCOMFamilyEvent.Create);
            f.RegisterTag("MARS", GEDCOMFamilyEvent.Create);
            f.RegisterTag("RESI", GEDCOMFamilyEvent.Create);
            f.RegisterTag("EVEN", GEDCOMFamilyEvent.Create);
        }
Example #5
0
        static GEDCOMIndividualRecord()
        {
            GEDCOMFactory f = new GEDCOMFactory();

            fTagsFactory = f;

            f.RegisterTag("FAMC", GEDCOMChildToFamilyLink.Create);
            f.RegisterTag("FAMS", GEDCOMSpouseToFamilyLink.Create);
            f.RegisterTag("ASSO", GEDCOMAssociation.Create);
            f.RegisterTag("ALIA", GEDCOMAlias.Create);

            f.RegisterTag("BAPL", GEDCOMIndividualOrdinance.Create);
            f.RegisterTag("CONL", GEDCOMIndividualOrdinance.Create);
            f.RegisterTag("ENDL", GEDCOMIndividualOrdinance.Create);
            f.RegisterTag("SLGC", GEDCOMIndividualOrdinance.Create);

            // // //

            f.RegisterTag("BIRT", GEDCOMIndividualEvent.Create);
            f.RegisterTag("CHR", GEDCOMIndividualEvent.Create);
            f.RegisterTag("DEAT", GEDCOMIndividualEvent.Create);
            f.RegisterTag("BURI", GEDCOMIndividualEvent.Create);
            f.RegisterTag("CREM", GEDCOMIndividualEvent.Create);

            f.RegisterTag("ADOP", GEDCOMIndividualEvent.Create);
            f.RegisterTag("BAPM", GEDCOMIndividualEvent.Create);
            f.RegisterTag("BARM", GEDCOMIndividualEvent.Create);
            f.RegisterTag("BASM", GEDCOMIndividualEvent.Create);
            f.RegisterTag("BLES", GEDCOMIndividualEvent.Create);

            f.RegisterTag("CHRA", GEDCOMIndividualEvent.Create);
            f.RegisterTag("CONF", GEDCOMIndividualEvent.Create);
            f.RegisterTag("FCOM", GEDCOMIndividualEvent.Create);
            f.RegisterTag("ORDN", GEDCOMIndividualEvent.Create);
            f.RegisterTag("NATU", GEDCOMIndividualEvent.Create);

            f.RegisterTag("EMIG", GEDCOMIndividualEvent.Create);
            f.RegisterTag("IMMI", GEDCOMIndividualEvent.Create);
            f.RegisterTag("CENS", GEDCOMIndividualEvent.Create);
            f.RegisterTag("PROB", GEDCOMIndividualEvent.Create);
            f.RegisterTag("WILL", GEDCOMIndividualEvent.Create);

            f.RegisterTag("GRAD", GEDCOMIndividualEvent.Create);
            f.RegisterTag("RETI", GEDCOMIndividualEvent.Create);
            f.RegisterTag("EVEN", GEDCOMIndividualEvent.Create);


            f.RegisterTag("CAST", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("DSCR", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("EDUC", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("IDNO", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("NATI", GEDCOMIndividualAttribute.Create);

            f.RegisterTag("NCHI", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("NMR", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("OCCU", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("PROP", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("RELI", GEDCOMIndividualAttribute.Create);

            f.RegisterTag("RESI", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("SSN", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("TITL", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("FACT", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_TRAVEL", GEDCOMIndividualAttribute.Create);

            f.RegisterTag("_HOBBY", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_AWARD", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_MILI", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_MILI_IND", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_MILI_DIS", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_MILI_RANK", GEDCOMIndividualAttribute.Create);

            f.RegisterTag("_BGRO", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_HAIR", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_EYES", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_MDNA", GEDCOMIndividualAttribute.Create);
            f.RegisterTag("_YDNA", GEDCOMIndividualAttribute.Create);
        }