예제 #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;
        }
예제 #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;
        }
예제 #3
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);

            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;
        }