Ejemplo n.º 1
0
        public object ConstructClassProxy(Type type, IEnumerable <IInterceptor> interceptors, IUnityAddonSP sp)
        {
            var proxyBean = ProxyGenerator.CreateClassProxy(
                type,
                ParameterFill.FillAllParamaters(CtorResolver.ChooseConstuctor(type, sp), sp),
                interceptors.ToArray());

            PropertyFill.FillAllProperties(type, proxyBean, sp);

            return(PostConstruct(type, proxyBean));
        }
Ejemplo n.º 2
0
        public object Construct(Type type, IUnityAddonSP sp)
        {
            if (type.IsInterface)
            {
                return(ProxyGenerator.CreateInterfaceProxyWithoutTarget(type));
            }

            var ctor = CtorResolver.ChooseConstuctor(type, sp);
            var bean = ctor.Invoke(ParameterFill.FillAllParamaters(ctor, sp).ToArray());

            PropertyFill.FillAllProperties(type, bean, sp);

            return(PostConstruct(type, bean));
        }