我必须进行反射和后期绑定,所以我不知道是否有办法加快速度。以为我会试一试。
这个片段大约需要 15 秒才能完成,这太慢了,但看看我需要如何读取元数据。
private static object InvokeCall(Type HostObjectType, Object HostObject, CallType callType, string PropertyOrMethodName, object[] args)
{
if (callType == CallType.Method)
{
return MyObjectType.InvokeMember(PropertyOrMethodName,System.Reflection.BindingFlags.InvokeMethod, null, myObject, args);
}
}