Пример #1
0
        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());
            }
        }
Пример #2
0
 public override bool IsEmpty()
 {
     return(base.IsEmpty() && fAddress.IsEmpty() && string.IsNullOrEmpty(fAgency) && string.IsNullOrEmpty(fCause) &&
            string.IsNullOrEmpty(fClassification) && fDate.IsEmpty() && fPlace.IsEmpty() &&
            string.IsNullOrEmpty(fReligiousAffilation) && (fRestriction == GDMRestriction.rnNone) &&
            (fNotes.Count == 0) && (fSourceCitations.Count == 0) && (fMultimediaLinks.Count == 0));
 }
Пример #3
0
        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());
            }
        }
Пример #4
0
 public override bool IsEmpty()
 {
     return(base.IsEmpty() && fCharacterSet.IsEmpty() && string.IsNullOrEmpty(fCopyright) && fFile.IsEmpty() &&
            fGEDCOM.IsEmpty() && (fLanguage == GDMLanguageID.Unknown) && fNote.IsEmpty() && fPlace.IsEmpty() &&
            string.IsNullOrEmpty(fReceivingSystemName) && fSource.IsEmpty() && fSubmission.IsEmpty() &&
            fSubmitter.IsEmpty() && (fTransmissionDateTime.Equals(GDMChangeDate.ZeroDateTime)));
 }
Пример #5
0
 public override bool IsEmpty()
 {
     return(base.IsEmpty() && fDate.IsEmpty() && fPlace.IsEmpty());
 }
Пример #6
0
 public override bool IsEmpty()
 {
     return(base.IsEmpty() && fDate.IsEmpty() &&
            (fPlace == null || fPlace.IsEmpty()));
 }
Пример #7
0
 public override bool IsEmpty()
 {
     return(base.IsEmpty() && fAddress.IsEmpty() && string.IsNullOrEmpty(fAgency) && string.IsNullOrEmpty(fCause) &&
            string.IsNullOrEmpty(fClassification) && fDate.IsEmpty() && fPlace.IsEmpty() &&
            string.IsNullOrEmpty(fReligiousAffilation) && fRestriction == GDMRestriction.rnNone);
 }