示例#1
0
        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);
        }
示例#2
0
        public GEDCOMLocationRecord CreateLocation()
        {
            GEDCOMLocationRecord result = new GEDCOMLocationRecord(this, this, "", "");

            result.InitNew();
            result.ChangeDate.ChangeDateTime = DateTime.Now;

            AddRecord(result);
            return(result);
        }
示例#3
0
        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);
            });
        }