Exemple #1
0
        private static MemberInfo[] GetAndWrapMember(IReflect reflect, Object namedItem, String name, BindingFlags bindingAttr)
        {
            PropertyInfo property = reflect.GetProperty(name, bindingAttr);

            if (property != null)
            {
                MethodInfo getMethod = JSProperty.GetGetMethod(property, false);
                MethodInfo setMethod = JSProperty.GetSetMethod(property, false);
                if ((getMethod != null && !getMethod.IsStatic) || (setMethod != null && !setMethod.IsStatic))
                {
                    MethodInfo method = reflect.GetMethod(name, bindingAttr);
                    if (method != null && !method.IsStatic)
                    {
                        MemberInfo[] propMethods = new MemberInfo[1];
                        propMethods[0] = new JSWrappedPropertyAndMethod(property, method, namedItem);
                        return(propMethods);
                    }
                }
            }
            MemberInfo[] members = reflect.GetMember(name, bindingAttr);
            if (members != null && members.Length > 0)
            {
                return(ScriptObject.WrapMembers(members, namedItem));
            }
            return(null);
        }
Exemple #2
0
 private static MemberInfo[] GetAndWrapMember(IReflect reflect, Object namedItem, String name, BindingFlags bindingAttr){
   PropertyInfo property = reflect.GetProperty(name, bindingAttr);
   if (property != null){
     MethodInfo getMethod = JSProperty.GetGetMethod(property, false);
     MethodInfo setMethod = JSProperty.GetSetMethod(property, false);
     if ((getMethod != null && !getMethod.IsStatic) || (setMethod != null && !setMethod.IsStatic)){
       MethodInfo method = reflect.GetMethod(name, bindingAttr);
       if (method != null && !method.IsStatic){
         MemberInfo[] propMethods = new MemberInfo[1];
         propMethods[0] = new JSWrappedPropertyAndMethod(property, method, namedItem);
         return propMethods;
       }
     }
   }
   MemberInfo[] members = reflect.GetMember(name, bindingAttr);
   if (members != null && members.Length > 0)
     return ScriptObject.WrapMembers(members, namedItem);
   return null;
 }