.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
RealProxy的PrivateInvoke方法在构造调用时的执行代码

作者:未知 来源:月光软件站 加入时间:2005-5-13 月光软件站

private void PrivateInvoke(ref MessageData msgData, int type)
{
IMessage message1 = null;
CallType type1 = (CallType) type;
IMessage message2 = null;
int num1 = -1;
RemotingProxy proxy1 = null;
////////////////////////
num1 = 0;
proxy1 = this as RemotingProxy;
ConstructorCallMessage message4 = null;
bool flag1 = false;
if (!this.IsRemotingProxy())
{
message4 = new ConstructorCallMessage(null, null, null, this.GetProxiedType());
}
else
{
message4 = proxy1.ConstructorMessage;
Identity identity1 = proxy1.IdentityObject;
if (identity1 != null)
{
flag1 = identity1.IsWellKnown();
}
}
if ((message4 == null) || flag1)
{
message4 = new ConstructorCallMessage(null, null, null, this.GetProxiedType());
message4.SetFrame(msgData);
message1 = message4;
if (flag1)
{
proxy1.ConstructorMessage = null;
if (message4.ArgCount != 0)
{
throw new RemotingException(Environment.GetResourceString("Remoting_Activation_WellKnownCTOR"));
}
}
message2 = new ConstructorReturnMessage((MarshalByRefObject) this.GetTransparentProxy(), null, 0, null, message4);
}
else
{
message4.SetFrame(msgData);
message1 = message4;
}
////////////////////////
ChannelServices.IncrementRemoteCalls();

if (message2 == null)
{
LogicalCallContext context1 = null;
Thread thread1 = Thread.CurrentThread;
context1 = thread1.GetLogicalCallContext();
this.SetCallContextInMessage(message1, num1, context1);
context1.PropagateOutgoingHeadersToMessage(message1);
message2 = this.Invoke(message1);
this.ReturnCallContextToThread(thread1, message2, num1, context1);
CallContext.GetLogicalCallContext().PropagateIncomingHeadersToCallContext(message2);
}
RealProxy.HandleReturnMessage(message1, message2);
////////////////////////
MarshalByRefObject obj1 = null;
IConstructionReturnMessage message7 = message2 as IConstructionReturnMessage;
if (message7 == null)
{
throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_BadReturnTypeForActivation"));
}
ConstructorReturnMessage message8 = message7 as ConstructorReturnMessage;
if (message8 != null)
{
obj1 = (MarshalByRefObject) message8.GetObject();
if (obj1 == null)
{
throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullReturnValue"));
}
}
else
{
obj1 = (MarshalByRefObject) RemotingServices.InternalUnmarshal((ObjRef) message7.ReturnValue, this.GetTransparentProxy(), true);
if (obj1 == null)
{
throw new RemotingException(Environment.GetResourceString("Remoting_Activation_NullFromInternalUnmarshal"));
}
}
if (obj1 != ((MarshalByRefObject) this.GetTransparentProxy()))
{
throw new RemotingException(Environment.GetResourceString("Remoting_Activation_InconsistentState"));
}
if (this.IsRemotingProxy())
{
proxy1.ConstructorMessage = null;
}
////////////////////////
}




相关文章

相关软件