Exemplo n.º 1
0
        public void testAhnenblattDate()
        {
            string gedcom = "0 HEAD\n1 SOUR AHN\n0 @I1@ INDI\n1 BIRT\n2 DATE (20/12-1980)";

            // TODO this bit needs to go into utility class
            GEDCOMTree     tee = new GEDCOMTree();
            GEDCOMProvider gp  = new GEDCOMProvider(tee);

            try {
                gp.LoadFromString(gedcom);
            } catch (Exception) {
            }
            Assert.AreEqual(1, tee.RecordsCount);
            GEDCOMRecord rec = tee[0];

            Assert.IsTrue(rec is GEDCOMIndividualRecord);
            GEDCOMIndividualRecord rec2 = (GEDCOMIndividualRecord)rec;
            // end for utility class

            GEDCOMList <GEDCOMCustomEvent> events = rec2.Events;

            Assert.AreEqual(1, events.Count);
            GEDCOMCustomEvent birt = events.Extract(0);
            GEDCOMDateValue   dv   = birt.Date;

            Assert.AreEqual("20 DEC 1980", dv.StringValue);
        }
Exemplo n.º 2
0
 public TreeEnumerator(GEDCOMTree tree, GEDCOMRecordType recType)
 {
     fTree     = tree;
     fIndex    = -1;
     fEndIndex = tree.RecordsCount - 1;
     fRecType  = recType;
 }
Exemplo n.º 3
0
        public override void ResetOwner(GEDCOMTree newOwner)
        {
            base.ResetOwner(newOwner);

            fChildren.ResetOwner(newOwner);
            fSpouseSealings.ResetOwner(newOwner);
        }
Exemplo n.º 4
0
        public void Test_ResetOwner()
        {
            GEDCOMTree    newOwner = new GEDCOMTree();
            GEDCOMAddress instance = (GEDCOMAddress)GEDCOMAddress.Create(null, null, "", "");

            instance.ResetOwner(newOwner);
            Assert.AreEqual(newOwner, instance.Owner);
        }
Exemplo n.º 5
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetRecordType(GEDCOMRecordType.rtSource);
            SetName("SOUR");

            fRepositoryCitations = new GEDCOMList <GEDCOMRepositoryCitation>(this);
        }
Exemplo n.º 6
0
 public override void ResetOwner(GEDCOMTree newOwner)
 {
     base.ResetOwner(newOwner);
     fPhoneList.ResetOwner(newOwner);
     fEmailList.ResetOwner(newOwner);
     fFaxList.ResetOwner(newOwner);
     fWWWList.ResetOwner(newOwner);
 }
Exemplo n.º 7
0
 public override void ResetOwner(GEDCOMTree newOwner)
 {
     base.ResetOwner(newOwner);
     if (fValue != null)
     {
         fValue.ResetOwner(newOwner);
     }
 }
Exemplo n.º 8
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetRecordType(GEDCOMRecordType.rtGroup);
            SetName("_GROUP");

            fMembers = new GEDCOMList <GEDCOMPointer>(this);
        }
Exemplo n.º 9
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetRecordType(GEDCOMRecordType.rtMultimedia);
            SetName("OBJE");

            fFileReferences = new GEDCOMList <GEDCOMFileReferenceWithTitle>(this);
        }
Exemplo n.º 10
0
        public override void ResetOwner(GEDCOMTree newOwner)
        {
            base.ResetOwner(newOwner);

            fNotes.ResetOwner(newOwner);
            fSourceCitations.ResetOwner(newOwner);
            fMultimediaLinks.ResetOwner(newOwner);
        }
Exemplo n.º 11
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);

            fNotes           = new GEDCOMList <GEDCOMNotes>(this);
            fSourceCitations = new GEDCOMList <GEDCOMSourceCitation>(this);
            fMultimediaLinks = new GEDCOMList <GEDCOMMultimediaLink>(this);
        }
Exemplo n.º 12
0
        public static GEDCOMDateRange CreateRange(GEDCOMTree owner, GEDCOMObject parent, GEDCOMDate dateAfter, GEDCOMDate dateBefore)
        {
            GEDCOMDateRange result = new GEDCOMDateRange(owner, parent, "", "");

            result.After.Assign(dateAfter);
            result.Before.Assign(dateBefore);
            return(result);
        }
Exemplo n.º 13
0
        public override void ResetOwner(GEDCOMTree newOwner)
        {
            base.ResetOwner(newOwner);

            fTasks.ResetOwner(newOwner);
            fCommunications.ResetOwner(newOwner);
            fGroups.ResetOwner(newOwner);
        }
Exemplo n.º 14
0
        public static GEDCOMDate CreateApproximated(GEDCOMTree owner, GEDCOMObject parent, GEDCOMDate date, GEDCOMApproximated approximated)
        {
            GEDCOMDate result = new GEDCOMDate(owner, parent, "", "");

            result.Assign(date);
            result.Approximated = approximated;
            return(result);
        }
Exemplo n.º 15
0
        public static GEDCOMDatePeriod CreatePeriod(GEDCOMTree owner, GEDCOMObject parent, GEDCOMDate dateFrom, GEDCOMDate dateTo)
        {
            GEDCOMDatePeriod result = new GEDCOMDatePeriod(owner, parent, "", "");

            result.DateFrom.Assign(dateFrom);
            result.DateTo.Assign(dateTo);
            return(result);
        }
Exemplo n.º 16
0
        public void Test_GetGEDCOMFormat()
        {
            GEDCOMTree tree = new GEDCOMTree();

            // Tests of determine GEDCOM-format
            Assert.AreEqual(GEDCOMFormat.gf_Unknown, GEDCOMProvider.GetGEDCOMFormat(tree));
            tree.Header.Source = "GENBOX";
            Assert.AreEqual(GEDCOMFormat.gf_GENBOX, GEDCOMProvider.GetGEDCOMFormat(tree));
        }
Exemplo n.º 17
0
        public void testResetOwner()
        {
            GEDCOMTree         newOwner = new GEDCOMTree();
            GEDCOMPersonalName instance = new GEDCOMPersonalName(null, null, "", "");

            instance.ResetOwner(newOwner);

            Assert.AreEqual(newOwner, instance.Owner);
        }
Exemplo n.º 18
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetRecordType(GEDCOMRecordType.rtFamily);
            SetName("FAM");

            fChildren       = new GEDCOMList <GEDCOMPointer>(this);
            fSpouseSealings = new GEDCOMList <GEDCOMSpouseSealing>(this);
        }
Exemplo n.º 19
0
        public GEDCOMTag(GEDCOMTree owner, GEDCOMObject parent, string tagName, string tagValue)
        {
            CreateObj(owner, parent);

            if (tagName != "" || tagValue != "")
            {
                SetName(tagName);
                SetStringValue(tagValue);
            }
        }
Exemplo n.º 20
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetName("ADDR");

            fPhoneList = new GEDCOMList <GEDCOMTag>(this);
            fEmailList = new GEDCOMList <GEDCOMTag>(this);
            fFaxList   = new GEDCOMList <GEDCOMTag>(this);
            fWWWList   = new GEDCOMList <GEDCOMTag>(this);
        }
Exemplo n.º 21
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetRecordType(GEDCOMRecordType.rtResearch);
            SetName("_RESEARCH");

            fTasks          = new GEDCOMList <GEDCOMPointer>(this);
            fCommunications = new GEDCOMList <GEDCOMPointer>(this);
            fGroups         = new GEDCOMList <GEDCOMPointer>(this);
        }
Exemplo n.º 22
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            fRecordType = GEDCOMRecordType.rtNone;

            fNotes           = new GEDCOMList <GEDCOMNotes>(this);
            fSourceCitations = new GEDCOMList <GEDCOMSourceCitation>(this);
            fMultimediaLinks = new GEDCOMList <GEDCOMMultimediaLink>(this);
            fUserReferences  = new GEDCOMList <GEDCOMUserReference>(this);
        }
Exemplo n.º 23
0
        public GEDCOMTag CreateTag(GEDCOMTree owner, GEDCOMObject parent, string tagName, string tagValue)
        {
            TagConstructor constructor;

            if (fConstructors.TryGetValue(tagName, out constructor))
            {
                return(constructor(owner, parent, tagName, tagValue));
            }

            return(null);
        }
Exemplo n.º 24
0
        public void testCreate()
        {
            GEDCOMTree   owner     = null;
            GEDCOMObject parent    = null;
            string       tagName   = "";
            string       tagValue  = "";
            GEDCOMTag    expResult = null;
            GEDCOMTag    result    = GEDCOMPersonalName.Create(owner, parent, tagName, tagValue);

            Assert.IsNotNull(result);
        }
Exemplo n.º 25
0
        public void testCreate()
        {
            GEDCOMTree   owner     = null;
            GEDCOMObject parent    = null;
            string       tagName   = "BLAH";
            string       tagValue  = "";
            GEDCOMTag    expResult = null;
            GEDCOMTag    result    = GEDCOMDate.Create(owner, parent, tagName, tagValue);

            Assert.IsNotNull(result);
            Assert.AreEqual(tagName, result.Name);
        }
Exemplo n.º 26
0
 public override void ResetOwner(GEDCOMTree newOwner)
 {
     base.ResetOwner(newOwner);
     if (fDateAfter != null)
     {
         fDateAfter.ResetOwner(newOwner);
     }
     if (fDateBefore != null)
     {
         fDateBefore.ResetOwner(newOwner);
     }
 }
Exemplo n.º 27
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetName("NAME");

            fPieces = new GEDCOMPersonalNamePieces(owner, this, "", "");
            fPieces.SetLevel(Level);

            fFirstPart = "";
            fSurname   = "";
            fLastPart  = "";
        }
Exemplo n.º 28
0
 public override void ResetOwner(GEDCOMTree newOwner)
 {
     base.ResetOwner(newOwner);
     if (fDateFrom != null)
     {
         fDateFrom.ResetOwner(newOwner);
     }
     if (fDateTo != null)
     {
         fDateTo.ResetOwner(newOwner);
     }
 }
Exemplo n.º 29
0
        public GEDCOMTag(GEDCOMTree owner, GEDCOMObject parent, string tagName, string tagValue)
        {
            CreateObj(owner, parent);

            if (!string.IsNullOrEmpty(tagName))
            {
                SetName(tagName);
            }

            if (!string.IsNullOrEmpty(tagValue))
            {
                SetStringValue(tagValue);
            }
        }
Exemplo n.º 30
0
        protected override void CreateObj(GEDCOMTree owner, GEDCOMObject parent)
        {
            base.CreateObj(owner, parent);
            SetName("DATE");

            fApproximated = GEDCOMApproximated.daExact;
            fCalendar     = GEDCOMCalendar.dcGregorian;
            fYear         = UNKNOWN_YEAR;
            fYearBC       = false;
            fYearModifier = "";
            fMonth        = "";
            fDay          = 0;
            fDateFormat   = GEDCOMDateFormat.dfGEDCOMStd;
        }