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()); } }
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); }
public GDMPlace() { SetName(GEDCOMTagType.PLAC); fForm = string.Empty; fLocation = new GDMPointer((int)GEDCOMTagType._LOC, string.Empty); fMap = new GDMMap(); }
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; }
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()); } }
public GDMLocationRecord(GDMObject owner) : base(owner) { SetName(GEDCOMTagType._LOC); fMap = new GDMMap(this); }
public GDMLocationRecord(GDMTree tree) : base(tree) { SetName(GEDCOMTagType._LOC); fMap = new GDMMap(); }