Beispiel #1
0
        public void KillAllSubscribers()
        {
            if (OnClicked != null)
            {
                foreach (var del in OnClicked?.GetInvocationList())
                {
                    OnClicked -= (Action)del;
                }
            }

            if (OnHovered != null)
            {
                foreach (var del in OnHovered?.GetInvocationList())
                {
                    OnHovered -= (Action)del;
                }
            }

            if (OnUnhovered != null)
            {
                foreach (var del in OnUnhovered?.GetInvocationList())
                {
                    OnUnhovered -= (Action)del;
                }
            }

            if (OnPressed != null)
            {
                foreach (var del in OnPressed?.GetInvocationList())
                {
                    OnPressed -= (Action)del;
                }
            }

            if (OnReleased != null)
            {
                foreach (var del in OnReleased?.GetInvocationList())
                {
                    OnReleased -= (Action)del;
                }
            }

            if (OnHold != null)
            {
                foreach (var del in OnHold?.GetInvocationList())
                {
                    OnHold -= (Action)del;
                }
            }
        }