コード例 #1
0
ファイル: GDMCustomEvent.cs プロジェクト: m-kosina/GEDKeeper
        public override void ReplaceXRefs(GDMXRefReplacer map)
        {
            base.ReplaceXRefs(map);

            if (fAddress != null)
            {
                fAddress.ReplaceXRefs(map);
            }
            fDate.ReplaceXRefs(map);
            if (fPlace != null)
            {
                fPlace.ReplaceXRefs(map);
            }
            if (fNotes != null)
            {
                fNotes.ReplaceXRefs(map);
            }
            if (fSourceCitations != null)
            {
                fSourceCitations.ReplaceXRefs(map);
            }
            if (fMultimediaLinks != null)
            {
                fMultimediaLinks.ReplaceXRefs(map);
            }
        }
コード例 #2
0
ファイル: GDMPlaceTests.cs プロジェクト: Akeloya/GEDKeeper
        public void Test_Common()
        {
            using (GDMPlace place = new GDMPlace(null)) {
                Assert.IsNotNull(place);

                place.Form = "abrakadabra";
                Assert.AreEqual("abrakadabra", place.Form);

                Assert.IsNotNull(place.Map);
                Assert.IsNotNull(place.Location);

                var note = new GDMNotes(place);
                note.Lines.Text = "place notes";
                place.Notes.Add(note);

                using (GDMPlace place2 = new GDMPlace(null)) {
                    Assert.Throws(typeof(ArgumentException), () => {
                        place2.Assign(null);
                    });

                    place2.Assign(place);

                    string buf = TestUtils.GetTagStreamText(place2, 1);
                    Assert.AreEqual("1 PLAC\r\n" +
                                    "2 NOTE place notes\r\n" +
                                    "2 FORM abrakadabra\r\n", buf);
                }

                place.ReplaceXRefs(new GDMXRefReplacer());

                Assert.IsFalse(place.IsEmpty());
                place.Clear();
                Assert.IsTrue(place.IsEmpty());
            }
        }
コード例 #3
0
 public override void ReplaceXRefs(GDMXRefReplacer map)
 {
     base.ReplaceXRefs(map);
     if (fPlace != null)
     {
         fPlace.ReplaceXRefs(map);
     }
 }
コード例 #4
0
        public override void ReplaceXRefs(GDMXRefReplacer map)
        {
            base.ReplaceXRefs(map);

            fAddress.ReplaceXRefs(map);
            fDate.ReplaceXRefs(map);
            fPlace.ReplaceXRefs(map);
        }
コード例 #5
0
ファイル: GDMCustomEvent.cs プロジェクト: Akeloya/GEDKeeper
        public override void ReplaceXRefs(GDMXRefReplacer map)
        {
            base.ReplaceXRefs(map);

            fAddress.ReplaceXRefs(map);
            fDate.ReplaceXRefs(map);
            fPlace.ReplaceXRefs(map);
            fNotes.ReplaceXRefs(map);
            fSourceCitations.ReplaceXRefs(map);
            fMultimediaLinks.ReplaceXRefs(map);
        }
コード例 #6
0
ファイル: GDMPlaceTests.cs プロジェクト: m-kosina/GEDKeeper
        public void Test_Common()
        {
            using (GDMPlace place = new GDMPlace()) {
                Assert.IsNotNull(place);

                place.Form = "abrakadabra";
                Assert.AreEqual("abrakadabra", place.Form);

                Assert.IsNotNull(place.Map);
                Assert.IsNotNull(place.Location);

                var note = new GDMNotes();
                note.Lines.Text = "place notes";
                place.Notes.Add(note);

                using (GDMPlace place2 = new GDMPlace()) {
                    Assert.Throws(typeof(ArgumentException), () => {
                        place2.Assign(null);
                    });

                    var iRec = new GDMIndividualRecord(null);
                    var evt  = new GDMIndividualEvent();
                    evt.SetName("BIRT");
                    iRec.Events.Add(evt);
                    //place2.Assign(place);
                    evt.Place.Assign(place);

                    string buf = TestUtils.GetTagStreamText(iRec, 1);
                    Assert.AreEqual("0 INDI\r\n" +
                                    "1 SEX U\r\n" +
                                    "1 BIRT\r\n" +
                                    "2 PLAC\r\n" +
                                    "3 NOTE place notes\r\n" +
                                    "3 FORM abrakadabra\r\n", buf);
                }

                place.ReplaceXRefs(new GDMXRefReplacer());

                Assert.IsFalse(place.IsEmpty());
                place.Clear();
                Assert.IsTrue(place.IsEmpty());
            }
        }