internal static object GetValue(PropertyInfo prop, object obj, object[] index) { JSProperty property = prop as JSProperty; if (property != null) { return(property.GetValue(obj, BindingFlags.ExactBinding, null, index, null)); } JSWrappedProperty property2 = prop as JSWrappedProperty; if (property2 != null) { return(property2.GetValue(obj, BindingFlags.ExactBinding, null, index, null)); } MethodInfo getMethod = GetGetMethod(prop, false); if (getMethod != null) { try { return(getMethod.Invoke(obj, BindingFlags.ExactBinding, null, index, null)); } catch (TargetInvocationException exception) { throw exception.InnerException; } } throw new MissingMethodException(); }
internal static Object GetValue(PropertyInfo prop, Object obj, Object[] index) { JSProperty jsprop = prop as JSProperty; if (jsprop != null) { return(jsprop.GetValue(obj, BindingFlags.ExactBinding, null, index, null)); } JSWrappedProperty jswrappedprop = prop as JSWrappedProperty; if (jswrappedprop != null) { return(jswrappedprop.GetValue(obj, BindingFlags.ExactBinding, null, index, null)); } MethodInfo meth = JSProperty.GetGetMethod(prop, false); if (meth != null) { return(meth.Invoke(obj, BindingFlags.ExactBinding, null, index, null)); } throw new MissingMethodException(); }