Ejemplo n.º 1
0
        public T CreateYard()
        {
            var interceptor = new ServiceInterceptor <T>(ThePools, App, Version);
            var result      = InterfaceProxy.New <T>(interceptor);

            return(result);
        }
        private static object New(Type clazz)
        {
            object[] attrs = clazz.GetCustomAttributes(typeof(ServiceObjectAttribute), false);
            if (attrs.Length <= 0)
            {
                return(ServiceBaseContainer.Current.Get(clazz));
            }
            ServiceObjectAttribute attr = (ServiceObjectAttribute)attrs[0];

            if (attr.ServiceFilter == null)
            {
                throw new ArgumentException();
            }
            object filter = ServiceFilterContainer.Current.Get(attr.ServiceFilter);

            if (filter == null)
            {
                throw new ArgumentException();
            }
            return(InterfaceProxy.New(clazz, (InvocationHandler)filter));
        }