Ejemplo n.º 1
0
        public static void RemovedHandler(this IRelicManager manager, RelicNotifyHandler notifyHandler)
        {
            if (manager == null)
            {
                return;
            }

            var notifier = manager.Notifier;

            if (notifier == null)
            {
                return;
            }

            notifier.Removed += notifyHandler;
        }
Ejemplo n.º 2
0
        private void ExecuteHandlers(RelicItem item, RelicNotifyHandler tempNotifyHandler)
        {
            if (tempNotifyHandler == null)
            {
                return;
            }

            var handlerList = tempNotifyHandler.GetInvocationList();

            foreach (RelicNotifyHandler handler in handlerList)
            {
                try {
                    handler(item);
                }
                catch (Exception exception) {
                    OnErrored(item, exception);
                }
            }
        }