示例#1
0
		public void AttachServerObject (MarshalByRefObject serverObject, Context context)
		{
			DisposeServerObject();

			_context = context;
			_serverObject = serverObject;
			
			if (RemotingServices.IsTransparentProxy (serverObject))
			{
				RealProxy rp = RemotingServices.GetRealProxy (serverObject);
				if (rp.ObjectIdentity == null)
					rp.ObjectIdentity = this;
			}
			else
			{
				if (_objectType.IsContextful)
					_envoySink = context.CreateEnvoySink (serverObject);
	
				_serverObject.ObjectIdentity = this;
			}
		}