Exemplo n.º 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);
        }
Exemplo n.º 2
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);
        }