コード例 #1
0
ファイル: GEDCOMTree.cs プロジェクト: fire-eggs/GEDKeeper
        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
ファイル: GEDCOMTree.cs プロジェクト: fire-eggs/GEDKeeper
        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);
            });
        }