bool UnregisterCallback(long eventTypeId, Delegate callback, Capture useCapture)
        {
            if (callback == null)
            {
                return(false);
            }

            EventCallbackList callbackList = GetCallbackListForWriting();
            var callbackPhase = useCapture == Capture.Capture ? CallbackPhase.CaptureAndTarget : CallbackPhase.TargetAndBubbleUp;

            return(callbackList.Remove(eventTypeId, callback, callbackPhase));
        }
Exemple #2
0
        bool UnregisterCallback(long eventTypeId, Delegate callback, TrickleDown useTrickleDown)
        {
            if (callback == null)
            {
                return(false);
            }

            EventCallbackList callbackList = GetCallbackListForWriting();
            var callbackPhase = useTrickleDown == TrickleDown.TrickleDown ? CallbackPhase.TrickleDownAndTarget : CallbackPhase.TargetAndBubbleUp;

            return(callbackList.Remove(eventTypeId, callback, callbackPhase));
        }
        private bool UnregisterCallback(long eventTypeId, Delegate callback, Capture useCapture)
        {
            bool result;

            if (callback == null)
            {
                result = false;
            }
            else
            {
                EventCallbackList callbackListForWriting = this.GetCallbackListForWriting();
                CallbackPhase     phase = (useCapture != Capture.Capture) ? CallbackPhase.TargetAndBubbleUp : CallbackPhase.CaptureAndTarget;
                result = callbackListForWriting.Remove(eventTypeId, callback, phase);
            }
            return(result);
        }