------ #### ryControlsV4 V3.0.2107.0101 - *.[新增]新增Sheng.Winform.Controls部分控件。 #### RyWeb V3.0.2107.0101 - *.[新增]QuickWeb新增引用页设置。 #### MyDbV4 V3.0.2107.0101 - *.[新增]支持忽略大小写的替换功能。
32 lines
868 B
C#
32 lines
868 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Reflection;
|
|
using System.Diagnostics;
|
|
|
|
namespace Sheng.Winform.Controls.Kernal
|
|
{
|
|
public class MethodInvokerPool : FastReflectionPool<string,IMethodInvoker>
|
|
{
|
|
protected override IMethodInvoker Create(Type type, string key)
|
|
{
|
|
if (type == null || String.IsNullOrEmpty(key))
|
|
{
|
|
Debug.Assert(false, "type 或 key 为空");
|
|
throw new ArgumentNullException();
|
|
}
|
|
|
|
MethodInfo methodInfo = type.GetMethod(key);
|
|
|
|
if (methodInfo == null)
|
|
{
|
|
Debug.Assert(false, "没有指定的MethodInfo:" + key);
|
|
throw new MissingMemberException(key);
|
|
}
|
|
|
|
return new MethodInvoker(methodInfo);
|
|
}
|
|
}
|
|
}
|