Пример #1
0
        public T GetRPC <T>()
        {
            Type type = typeof(T);

            if (ZYProxyDiy.ContainsKey(type))
            {
                return((T)ZYProxyDiy[type].GetTransparentProxy());
            }
            else
            {
                ZYProxy proxy = new ZYProxy(type);

                proxy.Call += proxy_Call;

                ZYProxyDiy.Add(type, proxy);

                return((T)proxy.GetTransparentProxy());
            }
        }
Пример #2
0
        public T GetRPC <T>()
        {
            Type type = typeof(T);

            if (ZYProxyDiy.ContainsKey(type))
            {
                return((T)ZYProxyDiy[type].GetTransparentProxy());
            }
            else
            {
                ZYProxy proxy = new ZYProxy(type, IsCallReturn);

                proxy.CallHaveReturn += CallHaveReturn;
                proxy.CallNullReturn += CallNullReturn;

                ZYProxyDiy.AddOrUpdate(type, proxy, (x, y) => proxy);

                return((T)proxy.GetTransparentProxy());
            }
        }