using System; namespace IFramework { /// /// Activator 创建实例 对现池 /// /// public class ActivatorCreatePool : ObjectPool { private object[] args; /// /// ctor /// /// 构造固定参数 public ActivatorCreatePool(params object[] args) { this.args = args; } /// /// 创建 /// /// /// protected override T CreateNew(IEventArgs arg) { Type type = typeof(T); return (T)Activator.CreateInstance(type, args); } } }