示例#1
0
        public object UseService(Type type, string ns)
        {
            HproseInvocationHandler handler = new HproseInvocationHandler(this, ns);

            if (type.IsInterface)
            {
                return(Proxy.NewInstance(AppDomain.CurrentDomain, new Type[] { type }, handler));
            }
            else
            {
                return(Proxy.NewInstance(AppDomain.CurrentDomain, type.GetInterfaces(), handler));
            }
        }
示例#2
0
        public T UseService <T>(string ns)
        {
            Type type = typeof(T);
            HproseInvocationHandler handler = new HproseInvocationHandler(this, ns);

            if (type.IsInterface)
            {
                return((T)Proxy.NewInstance(AppDomain.CurrentDomain, new Type[] { type }, handler));
            }
            else
            {
                return((T)Proxy.NewInstance(AppDomain.CurrentDomain, type.GetInterfaces(), handler));
            }
        }
示例#3
0
        public object UseService(Type[] types, string ns)
        {
            HproseInvocationHandler handler = new HproseInvocationHandler(this, ns);

            return(Proxy.NewInstance(AppDomain.CurrentDomain, types, handler));
        }