private EventCallbackList GetCallbackListForWriting()
        {
            bool flag = this.m_IsInvoking > 0;
            EventCallbackList result;

            if (flag)
            {
                bool flag2 = this.m_TemporaryCallbacks == null;
                if (flag2)
                {
                    bool flag3 = this.m_Callbacks != null;
                    if (flag3)
                    {
                        this.m_TemporaryCallbacks = EventCallbackRegistry.GetCallbackList(this.m_Callbacks);
                    }
                    else
                    {
                        this.m_TemporaryCallbacks = EventCallbackRegistry.GetCallbackList(null);
                    }
                }
                result = this.m_TemporaryCallbacks;
            }
            else
            {
                bool flag4 = this.m_Callbacks == null;
                if (flag4)
                {
                    this.m_Callbacks = EventCallbackRegistry.GetCallbackList(null);
                }
                result = this.m_Callbacks;
            }
            return(result);
        }
        public void InvokeCallbacks(EventBase evt)
        {
            bool flag = this.m_Callbacks == null;

            if (!flag)
            {
                this.m_IsInvoking++;
                for (int i = 0; i < this.m_Callbacks.Count; i++)
                {
                    bool isImmediatePropagationStopped = evt.isImmediatePropagationStopped;
                    if (isImmediatePropagationStopped)
                    {
                        break;
                    }
                    this.m_Callbacks[i].Invoke(evt);
                }
                this.m_IsInvoking--;
                bool flag2 = this.m_IsInvoking == 0;
                if (flag2)
                {
                    bool flag3 = this.m_TemporaryCallbacks != null;
                    if (flag3)
                    {
                        EventCallbackRegistry.ReleaseCallbackList(this.m_Callbacks);
                        this.m_Callbacks = EventCallbackRegistry.GetCallbackList(this.m_TemporaryCallbacks);
                        EventCallbackRegistry.ReleaseCallbackList(this.m_TemporaryCallbacks);
                        this.m_TemporaryCallbacks = null;
                    }
                }
            }
        }