예제 #1
0
        /// <summary>
        /// 查找名称为 typeName 的类型,使用 args 进行初始化并返回透明代理
        /// </summary>
        public T GetReflectProxy <T>(string typeName, params object[] args) where T : IReflectProxy
        {
            Type          type    = this.Assembly.GetType(typeName);
            ReflectObject reflect = new ReflectObject(type).Constructor(args);

            return(ReflectProxy <T> .Creator(reflect));
        }
예제 #2
0
        /// <summary>
        /// 使用 args 参数实例化 type 类型,并返回透明代理
        /// </summary>
        public static T GetReflectProxy <T>(Type type, params object[] args) where T : IReflectProxy
        {
            ReflectObject reflect = new ReflectObject(type).Constructor(args);

            return(ReflectProxy <T> .Creator(reflect));
        }