Esempio n. 1
0
        public void Test_GDMMap()
        {
            using (GDMMap map = new GDMMap(null)) {
                map.Lati = 5.111111;
                Assert.AreEqual(5.111111, map.Lati);

                map.Long = 7.999999;
                Assert.AreEqual(7.999999, map.Long);

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

                    map2.Assign(map);

                    string buf = TestUtils.GetTagStreamText(map2, 1);
                    Assert.AreEqual("1 MAP\r\n" +
                                    "2 LATI 5.111111\r\n" +
                                    "2 LONG 7.999999\r\n", buf);
                }

                Assert.IsFalse(map.IsEmpty());
                map.Clear();
                Assert.IsTrue(map.IsEmpty());
            }
        }
Esempio n. 2
0
        public GDMPlace(GDMObject owner) : base(owner)
        {
            SetName(GEDCOMTagType.PLAC);

            fForm     = string.Empty;
            fLocation = new GDMPointer(this, (int)GEDCOMTagType._LOC, string.Empty);
            fMap      = new GDMMap(this);
        }
Esempio n. 3
0
        public GDMPlace()
        {
            SetName(GEDCOMTagType.PLAC);

            fForm     = string.Empty;
            fLocation = new GDMPointer((int)GEDCOMTagType._LOC, string.Empty);
            fMap      = new GDMMap();
        }
Esempio n. 4
0
        public override void Assign(GDMTag source)
        {
            GDMMap otherMap = (source as GDMMap);

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

            base.Assign(otherMap);

            fLati = otherMap.fLati;
            fLong = otherMap.fLong;
        }
Esempio n. 5
0
        public void Test_Common()
        {
            using (var map = new GDMMap()) {
                map.Lati = 5.111111;
                Assert.AreEqual(5.111111, map.Lati);

                map.Long = 7.999999;
                Assert.AreEqual(7.999999, map.Long);

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

                    //map2.Assign(map);

                    var iRec = new GDMIndividualRecord(null);
                    var evt  = new GDMIndividualEvent();
                    evt.SetName("BIRT");
                    iRec.Events.Add(evt);
                    evt.Place.Map.Assign(map);
                    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 MAP\r\n" +
                                    "4 LATI 5.111111\r\n" +
                                    "4 LONG 7.999999\r\n", buf);
                }

                Assert.IsFalse(map.IsEmpty());
                map.Clear();
                Assert.IsTrue(map.IsEmpty());
            }
        }
Esempio n. 6
0
        public GDMLocationRecord(GDMObject owner) : base(owner)
        {
            SetName(GEDCOMTagType._LOC);

            fMap = new GDMMap(this);
        }
Esempio n. 7
0
        public GDMLocationRecord(GDMTree tree) : base(tree)
        {
            SetName(GEDCOMTagType._LOC);

            fMap = new GDMMap();
        }