예제 #1
0
        public override void setDelegate(Delegate anyDelegate, String delegateName)
        {
            /* To support in compiler
             * switch(delegateName)
             * {
             * case "onDrag":
             *  m_onDragCallBack = (OnDragCallBack)anyDelegate;
             *  break;
             * case "onPinch":
             *  m_onPinchCallBack = (OnPinchCallBack) anyDelegate;
             *  break;
             * case "onClick":
             *  m_onClickCallBack = (OnClickCallBack)anyDelegate;
             *  break;
             * case "onDblClick":
             *  m_onDblClickCallBack = (OnDblClickCallBack)anyDelegate;
             *  break;
             * case "onLongtap":
             *  m_onLongTapCallBack = (OnLongTapCallBack)anyDelegate;
             *  break;
             * default:
             *  throw new CKLBException("Unvalid delegate name");
             * }
             */

            if (delegateName == "onDrag")
            {
                m_onDragCallBack = (OnDragCallBack)anyDelegate;
            }
            else if (delegateName == "onPinch")
            {
                m_onPinchCallBack = (OnPinchCallBack)anyDelegate;
            }
            else if (delegateName == "onClick")
            {
                m_onClickCallBack = (OnClickCallBack)anyDelegate;
            }
            else if (delegateName == "onDblClick")
            {
                m_onDblClickCallBack = (OnDblClickCallBack)anyDelegate;
            }
            else if (delegateName == "onLongtap")
            {
                m_onLongTapCallBack = (OnLongTapCallBack)anyDelegate;
            }
            else
            {
                throw new CKLBException("Unvalid delegate name");
            }
        }
예제 #2
0
        public override void setDelegate(Delegate anyDelegate, String delegateName)
        {
		/* To support in compiler
            switch(delegateName)
            {
                case "onDrag":
                    m_onDragCallBack = (OnDragCallBack)anyDelegate;
                    break;
                case "onPinch":
                    m_onPinchCallBack = (OnPinchCallBack) anyDelegate;
                    break;
                case "onClick":
                    m_onClickCallBack = (OnClickCallBack)anyDelegate;
                    break;
                case "onDblClick":
                    m_onDblClickCallBack = (OnDblClickCallBack)anyDelegate;
                    break;
                case "onLongtap":
                    m_onLongTapCallBack = (OnLongTapCallBack)anyDelegate;
                    break;
                default:
                    throw new CKLBException("Unvalid delegate name");
            }
			*/

			if(delegateName == "onDrag")
            {
                m_onDragCallBack = (OnDragCallBack)anyDelegate;
            }
            else if(delegateName == "onPinch")
            {
                m_onPinchCallBack = (OnPinchCallBack)anyDelegate;
            }
            else if(delegateName == "onClick")
            {
                m_onClickCallBack = (OnClickCallBack)anyDelegate;
            }
            else if(delegateName == "onDblClick")
            {
                m_onDblClickCallBack = (OnDblClickCallBack)anyDelegate;
            }
            else if(delegateName == "onLongtap")
            {
                m_onLongTapCallBack = (OnLongTapCallBack)anyDelegate;
            }
            else
            {
                throw new CKLBException("Unvalid delegate name");
            }
        }