Ejemplo n.º 1
0
        protected virtual void Wrap(T proxy)
        {
            realProxy = proxy;
            context   = RemotingServices.GetRealProxy(realProxy) as IRuntimeContext <Object>;

            if (typeof(IRuntimeContext <Object>).IsAssignableFrom(context.GetType()))
            {
                ((IRuntimeContext <Object>)context).OnBeginInvokeEvent += new BeginInvokeEventHandler <Object>(BeginInvokeEvent);
                ((IRuntimeContext <Object>)context).OnInvokeEvent      += new InvokeEventHandler <Object>(InvokeEvent);
                ((IRuntimeContext <Object>)context).OnEndInvokeEvent   += new EndInvokeEventHandler <Object>(EndInvokeEvent);
                ((IRuntimeContext <Object>)context).OnInvokeErrorEvent += new InvokeErrorEventHandler <Object>(InvokeErrorEvent);
            }
        }