Esempio n. 1
0
        /// <summary>
        /// 获取事件对应的动画
        /// </summary>
        /// <param name="eventArg"></param>
        /// <returns></returns>
        public UIAnimation getEventAnim(IEventArg eventArg)
        {
            Type type = eventArg.GetType();

            if (animConstructorDic.ContainsKey(type))
            {
                UIAnimation anim = null;
                if (animConstructorDic[type].GetParameters().Length == 0)
                {
                    anim = animConstructorDic[type].Invoke(new object[0]) as UIAnimation;
                }
                else if (animConstructorDic[type].GetParameters().Length == 1)
                {
                    anim = animConstructorDic[type].Invoke(new object[] { eventArg }) as UIAnimation;
                }
                if (anim is EventAnimation tAnim)
                {
                    tAnim.eventArg = eventArg;
                    tAnim.init(this);
                }
                return(anim);
            }
            else
            {
                return(null);
            }
        }
        public static string getName(IEventArg eventArg)
        {
            string name = eventArg.GetType().Name;

            if (name.EndsWith("EventArg"))
            {
                name = string.Intern(name.Substring(0, name.Length - 3));
            }
            return(name);
        }
Esempio n. 3
0
 public string getName(IEventArg eventArg)
 {
     return(getName(eventArg.GetType()));
 }
 public string getName(IEventArg eventArg)
 {
     return(eventArg.GetType().FullName);
 }