Пример #1
0
 public TouchHandler(TouchHandleDelegate handle, params object[] paramArray)
 {
     SetHandle(handle, paramArray);
 }
Пример #2
0
 public void SetHandle(TouchHandleDelegate handle, params object[] extras)
 {
     RemoveHandle();
     m_eventHandle += handle;
     this.m_extras  = extras;
 }
Пример #3
0
        public void AddHandle(TouchType touchType, TouchHandleDelegate handle, params object[] extras)
        {
            switch (touchType)
            {
            case TouchType.OnClick:
            {
                if (null == m_onClick)
                {
                    m_onClick = new TouchHandler();
                }
                m_onClick.SetHandle(handle, extras);
            } break;

            case TouchType.OnDoubleClick:
            {
                if (null == m_onDoubleClick)
                {
                    m_onDoubleClick = new TouchHandler();
                }
                m_onDoubleClick.SetHandle(handle, extras);
            } break;

            case TouchType.TouchUp:
            {
                if (null == m_onUp)
                {
                    m_onUp = new TouchHandler();
                }
                m_onUp.SetHandle(handle, extras);
            } break;

            case TouchType.TouchDown:
            {
                if (null == m_onDown)
                {
                    m_onDown = new TouchHandler();
                }
                m_onDown.SetHandle(handle, extras);
            } break;

            case TouchType.TouchEnter:
            {
                if (null == m_onEnter)
                {
                    m_onEnter = new TouchHandler();
                }
                m_onEnter.SetHandle(handle, extras);
            } break;

            case TouchType.TouchExit:
            {
                if (null == m_onExit)
                {
                    m_onExit = new TouchHandler();
                }
                m_onExit.SetHandle(handle, extras);
            } break;

            case TouchType.OnDrag:
            {
                if (null == m_onDrag)
                {
                    m_onDrag = new TouchHandler();
                }
                m_onDrag.SetHandle(handle, extras);
            } break;

            case TouchType.OnDragEnd:
            {
                if (null == m_onDragEnd)
                {
                    m_onDragEnd = new TouchHandler();
                }
                m_onDragEnd.SetHandle(handle, extras);
            } break;

            case TouchType.OnSelect:
            {
                if (null == m_onSelect)
                {
                    m_onSelect = new TouchHandler();
                }
                m_onSelect.SetHandle(handle, extras);
            } break;

            case TouchType.OnUpdateSelect:
            {
                if (null == m_onUpdateSelect)
                {
                    m_onUpdateSelect = new TouchHandler();
                }
                m_onUpdateSelect.SetHandle(handle, extras);
            } break;

            case TouchType.OnDeSelect:
            {
                if (null == m_onDeSelect)
                {
                    m_onDeSelect = new TouchHandler();
                }
                m_onDeSelect.SetHandle(handle, extras);
            } break;

            case TouchType.OnMove:
            {
                if (null == m_onMove)
                {
                    m_onMove = new TouchHandler();
                }
                m_onMove.SetHandle(handle, extras);
            } break;

            case TouchType.OnScroll:
            {
                if (null == m_onScroll)
                {
                    m_onScroll = new TouchHandler();
                }
                m_onScroll.SetHandle(handle, extras);
            } break;

            case TouchType.OnDrop:
            {
                if (null == m_onDrop)
                {
                    m_onDrop = new TouchHandler();
                }
                m_onDrop.SetHandle(handle, extras);
            } break;
            }
        }