public override void MoveTo(GEDCOMRecord targetRecord, bool clearDest) { GEDCOMRecordWithEvents target = targetRecord as GEDCOMRecordWithEvents; if (target == null) { throw new ArgumentException(@"Argument is null or wrong type", "targetRecord"); } base.MoveTo(targetRecord, clearDest); while (fEvents.Count > 0) { GEDCOMCustomEvent obj = fEvents.Extract(0); obj.ResetParent(target); target.AddEvent(obj); } }
public override void Assign(GEDCOMTag source) { GEDCOMRecordWithEvents sourceRec = source as GEDCOMRecordWithEvents; if (sourceRec == null) { throw new ArgumentException(@"Argument is null or wrong type", "source"); } base.Assign(source); foreach (GEDCOMCustomEvent sourceEvent in sourceRec.fEvents) { GEDCOMCustomEvent copy = (GEDCOMCustomEvent)Activator.CreateInstance(sourceEvent.GetType(), new object[] { Owner, this, "", "" }); copy.Assign(sourceEvent); AddEvent(copy); } }