コード例 #1
0
ファイル: EventManager.cs プロジェクト: NaleRaphael/MPLite
        private void DeleteEvent(IEvent target)
        {
            if (target == null)
            {
                return;
            }

            target.DisposeTimer();

            ActivatedEvents.Remove(target);
            ecdb.DeleteEvent((CustomEvent)target);

            EventIsDeletedEvent(target);
            target = null;
        }
コード例 #2
0
ファイル: EventManager.cs プロジェクト: NaleRaphael/MPLite
        public void DeleteEvent(Guid targetGUID)
        {
            // NOTE: delete event both in database and ActivatedList
            IEvent target = ecdb.GetEvent(targetGUID);

            if (target == null)
            {
                return;
            }

            // Delete target in both database and activated list
            ecdb.DeleteEvent(target.GUID);

            IEvent activatedTarget = ActivatedEvents.Find(x => x.GUID == targetGUID);

            if (activatedTarget != null)
            {
                activatedTarget.DisposeTimer();
                ActivatedEvents.Remove(activatedTarget);
            }

            EventIsDeletedEvent(target);
            target = null;
        }