예제 #1
0
        public GEDCOMRepositoryCitation AddRepository(GEDCOMRepositoryRecord repRec)
        {
            GEDCOMRepositoryCitation cit = null;

            if (repRec != null)
            {
                cit       = new GEDCOMRepositoryCitation(Owner, this, "", "");
                cit.Value = repRec;
                RepositoryCitations.Add(cit);
            }

            return(cit);
        }
예제 #2
0
        public override void MoveTo(GEDCOMRecord targetRecord, bool clearDest)
        {
            GEDCOMSourceRecord targetSource = targetRecord as GEDCOMSourceRecord;

            if (targetSource == null)
            {
                throw new ArgumentException(@"Argument is null or wrong type", "targetRecord");
            }

            StringList titl = new StringList();
            StringList orig = new StringList();
            StringList publ = new StringList();
            StringList text = new StringList();

            try
            {
                titl.Text = (targetSource.Title.Text + "\n" + Title.Text).Trim();
                orig.Text = (targetSource.Originator.Text + "\n" + Originator.Text).Trim();
                publ.Text = (targetSource.Publication.Text + "\n" + Publication.Text).Trim();
                text.Text = (targetSource.Text.Text + "\n" + Text.Text).Trim();

                DeleteTag("TITL");
                DeleteTag("TEXT");
                DeleteTag("ABBR");
                DeleteTag("PUBL");
                DeleteTag("AUTH");

                base.MoveTo(targetRecord, clearDest);

                targetSource.Title       = titl;
                targetSource.Originator  = orig;
                targetSource.Publication = publ;
                targetSource.Text        = text;

                while (fRepositoryCitations.Count > 0)
                {
                    GEDCOMRepositoryCitation obj = fRepositoryCitations.Extract(0);
                    obj.ResetParent(targetSource);
                    targetSource.RepositoryCitations.Add(obj);
                }
            }
            finally
            {
                titl.Dispose();
                orig.Dispose();
                publ.Dispose();
                text.Dispose();
            }
        }