Beispiel #1
0
        public override void Assign(GDMTag source)
        {
            GDMRecordWithEvents sourceRec = source as GDMRecordWithEvents;

            if (sourceRec == null)
            {
                throw new ArgumentException(@"Argument is null or wrong type", "source");
            }

            base.Assign(source);

            foreach (GDMCustomEvent sourceEvent in sourceRec.fEvents)
            {
                GDMCustomEvent copy = (GDMCustomEvent)Activator.CreateInstance(sourceEvent.GetType(), new object[] { this });
                copy.Assign(sourceEvent);
                AddEvent(copy);
            }

            fRestriction = sourceRec.Restriction;
        }
Beispiel #2
0
        public override void MoveTo(GDMRecord targetRecord, bool clearDest)
        {
            GDMRecordWithEvents target = targetRecord as GDMRecordWithEvents;

            if (target == null)
            {
                throw new ArgumentException(@"Argument is null or wrong type", "targetRecord");
            }

            base.MoveTo(targetRecord, clearDest);

            while (fEvents.Count > 0)
            {
                GDMCustomEvent obj = fEvents.Extract(0);
                obj.ResetOwner(target);
                target.AddEvent(obj);
            }

            target.Restriction = fRestriction;
        }
        public override void Assign(GDMTag source)
        {
            GDMRecordWithEvents sourceRec = source as GDMRecordWithEvents;

            if (sourceRec == null)
            {
                throw new ArgumentException(@"Argument is null or wrong type", "source");
            }

            base.Assign(source);

            for (int i = 0, count = sourceRec.fEvents.Count; i < count; i++)
            {
                GDMCustomEvent sourceEvent = sourceRec.fEvents[i];
                GDMCustomEvent copy        = (GDMCustomEvent)Activator.CreateInstance(sourceEvent.GetType());
                copy.Assign(sourceEvent);
                AddEvent(copy);
            }

            fRestriction = sourceRec.Restriction;
        }