Ejemplo n.º 1
0
        //private ExMethodInfo getExMethod(MethodInfo rmethod)
        //{
        //    //MethodInfo rmethod = method;
        //    /* 非 Abstract 的方法肯定从被映射的类中搜索 */
        //    if (rmethod.IsAbstract)
        //    {
        //        rmethod = searchMethodFromSharp(rmethod);
        //        ExMethodInfo exMethod = ZTypeUtil.CreatExMethodInfo(rmethod, this.SharpType);
        //        return exMethod;
        //    }
        //    else
        //    {
        //        ExMethodInfo exMethod = ZTypeUtil.CreatExMethodInfo(rmethod, this.ZMappingType);
        //        return exMethod;
        //    }
        //}

        private MethodInfo searchMethodFromSharp(MethodInfo method)
        {
            ParameterInfo[] paramArray = method.GetParameters();
            Type[]          types      = new Type[paramArray.Length];
            for (int i = 0; i < paramArray.Length; i++)
            {
                types[i] = paramArray[i].ParameterType;
            }
            MethodInfo rmethod = SharpType.GetMethod(method.Name, types);

            return(rmethod);
        }