private void _InvokeMethodAsync(object parmList)
{
object[] parms = parmList as object[];
object cb = parms[0];
if (cb is DBNull)
cb = null;
object instance = parms[1];
string method = parms[2] as string;
object[] parameters = parms[3] as object[];
bool isStatic = false;
if (parms.Length > 4)
isStatic = (bool) parms[4];
object result = null;
try
{
if (!isStatic)
{
if (parameters == null || parameters.Length < 1)
result = InvokeMethod_Internal(instance, method);
else
result = InvokeMethod_Internal(instance, method, parameters);
}
else
{
if (parameters == null || parameters.Length < 1)
result = InvokeStaticMethod_Internal(instance as string, method);
else
result = InvokeStaticMethod_Internal(instance as string, method, parameters);
}
}
catch (Exception ex)
{
if (cb != null)
InvokeMethod_Internal(cb, "onError", ex.Message, ex.GetBaseException(), method);
return;
}
if(cb != null)
InvokeMethod_Internal(cb, "onCompleted", result, method);
}