public bool DeleteLocationRecord(GEDCOMLocationRecord locRec) { if (locRec == null) { return(false); } int num = fRecords.Count; for (int i = 0; i < num; i++) { var evsRec = this[i] as GEDCOMRecordWithEvents; if (evsRec != null) { for (int j = evsRec.Events.Count - 1; j >= 0; j--) { GEDCOMCustomEvent ev = evsRec.Events[j]; if (ev.Place.Location.Value == locRec) { ev.Place.DeleteTag("_LOC"); } } } } DeleteRecord(locRec); return(true); }
public GEDCOMLocationRecord CreateLocation() { GEDCOMLocationRecord result = new GEDCOMLocationRecord(this, this, "", ""); result.InitNew(); result.ChangeDate.ChangeDateTime = DateTime.Now; AddRecord(result); return(result); }
public void testMoveTo1() { GEDCOMRecord other = new GEDCOMLocationRecord(null, null, "", ""); GEDCOMNoteRecord instance = (GEDCOMNoteRecord)GEDCOMNoteRecord.Create(null, null, "", ""); bool clearDest = false; Assert.Throws(typeof(ArgumentException), () => { instance.MoveTo(other, clearDest); }); }