本文整理汇总了C#中System.Runtime.Remoting.Messaging.LogicalCallContext类的典型用法代码示例。如果您正苦于以下问题:C# LogicalCallContext类的具体用法?C# LogicalCallContext怎么用?C# LogicalCallContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogicalCallContext类属于System.Runtime.Remoting.Messaging命名空间,在下文中一共展示了LogicalCallContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ADAsyncWorkItem
internal ADAsyncWorkItem(IMessage reqMsg, IMessageSink nextSink, IMessageSink replySink)
{
this._reqMsg = reqMsg;
this._nextSink = nextSink;
this._replySink = replySink;
this._callCtx = CallContext.GetLogicalCallContext();
}
示例2: Read
public void Read(__BinaryParser input)
{
this.messageEnum = (MessageEnum) input.ReadInt32();
if (IOUtil.FlagTest(this.messageEnum, MessageEnum.NoReturnValue))
{
this.returnValue = null;
}
else if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ReturnValueVoid))
{
this.returnValue = instanceOfVoid;
}
else if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ReturnValueInline))
{
this.returnValue = IOUtil.ReadWithCode(input);
}
if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ContextInline))
{
this.scallContext = (string) IOUtil.ReadWithCode(input);
LogicalCallContext context = new LogicalCallContext {
RemotingData = { LogicalCallID = this.scallContext }
};
this.callContext = context;
}
if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ArgsInline))
{
this.args = IOUtil.ReadArgs(input);
}
}
示例3: AsyncWorkItem
internal AsyncWorkItem(IMessage reqMsg, IMessageSink replySink, Context oldCtx, ServerIdentity srvID)
{
this._reqMsg = reqMsg;
this._replySink = replySink;
this._oldCtx = oldCtx;
this._callCtx = CallContext.GetLogicalCallContext();
this._srvID = srvID;
}
示例4: SetLogicalCallContext
// Sets the given logical call context object on the thread.
// Returns the previous one.
internal static LogicalCallContext SetLogicalCallContext(
LogicalCallContext callCtx)
{
ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext();
LogicalCallContext prev = ec.LogicalCallContext;
ec.LogicalCallContext = callCtx;
return prev;
}
示例5: ReturnMessage
public ReturnMessage(Object ret, Object[] outArgs, int outArgsCount,
LogicalCallContext callCtx, IMethodCallMessage mcm)
{
this.ret = ret;
this.outArgs = outArgs;
this.outArgsCount = outArgsCount;
this.callCtx = callCtx;
this.mcm = mcm;
}
示例6: MessageMethodInvocation
/// <summary>
/// Extracts and interprets fields from "IMessage"
///
/// Samle IMassage when the method "ToString" is called:
/// msg.Properties["__Uri"]
/// null
/// object
/// msg.Properties["__MethodName"]
/// "ToString"
/// object {string}
/// msg.Properties["__MethodSignature"]
/// {System.Type[0]}
/// object {System.Type[]}
/// msg.Properties["__TypeName"]
/// "System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/// object {string}
/// msg.Properties["__Args"]
/// {object[0]}
/// object {object[]}
/// msg.Properties["__CallContext"]
/// {System.Runtime.Remoting.Messaging.LogicalCallContext}
/// object {System.Runtime.Remoting.Messaging.LogicalCallContext}
/// Type.GetType((string)msg.Properties["__TypeName"]) == typeof(object)
/// true
/// bool
/// </summary>
/// <param name="msg"></param>
public MessageMethodInvocation(IMessage msg)
: base(msg.Properties["__TypeName"] as string,
msg.Properties["__MethodName"] as string,
msg.Properties["__MethodSignature"] as Type[],
msg.Properties["__Args"] as object[])
{
_message = msg;
_callContext = _message.Properties["__CallContext"] as LogicalCallContext;
}
示例7: ReturnMessage
public ReturnMessage (Exception e, IMethodCallMessage mcm)
{
_exception = e;
if (mcm != null) {
_methodBase = mcm.MethodBase;
_callCtx = mcm.LogicalCallContext;
}
_args = new object[0]; // .NET does this
}
示例8: ExecutionContext
private ExecutionContext (ExecutionContext ec)
{
#if !MOBILE
if (ec._sc != null)
_sc = new SecurityContext (ec._sc);
#endif
if (ec._lcc != null)
_lcc = (LogicalCallContext) ec._lcc.Clone ();
_suppressFlow = ec._suppressFlow;
_capture = true;
}
示例9: MethodResponse
internal MethodResponse(IMethodReturnMessage mrm)
{
outArgs = mrm.OutArgs;
methodName = mrm.MethodName;
typeName = mrm.TypeName;
uri = mrm.Uri;
hasVarArgs = mrm.HasVarArgs;
context = mrm.LogicalCallContext;
method = mrm.MethodBase;
exception = mrm.Exception;
returnValue = mrm.ReturnValue;
}
示例10: ExecutionContext
private ExecutionContext(SerializationInfo info, StreamingContext context)
{
SerializationInfoEnumerator enumerator = info.GetEnumerator();
while (enumerator.MoveNext())
{
if (enumerator.Name.Equals("LogicalCallContext"))
{
this._logicalCallContext = (System.Runtime.Remoting.Messaging.LogicalCallContext) enumerator.Value;
}
}
this.Thread = System.Threading.Thread.CurrentThread;
}
示例11: MethodMessage
internal MethodMessage(Type interfaceType, string methodName, object[] args, string identity, bool responseRequired)
{
this.interfaceType = interfaceType;
this.methodName = methodName;
this.args = args;
this.callContext = GetLogicalCallContext();
if (responseRequired)
{
this.returnValueSignalEvent = new ManualResetEvent(false);
}
this.PopulateIdentity(this.callContext, identity);
this.Clone();
}
示例12: ReturnMessage
public ReturnMessage (object ret, object [] outArgs,
int outArgsCount, LogicalCallContext callCtx,
IMethodCallMessage mcm)
{
// outArgCount tells how many values of outArgs are valid
_returnValue = ret;
_args = outArgs;
_callCtx = callCtx;
if (mcm != null) {
_uri = mcm.Uri;
_methodBase = mcm.MethodBase;
}
if (_args == null) _args = new object [outArgsCount];
}
示例13: Read
internal void Read(__BinaryParser input)
{
this.messageEnum = (MessageEnum) input.ReadInt32();
this.methodName = (string) IOUtil.ReadWithCode(input);
this.typeName = (string) IOUtil.ReadWithCode(input);
if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ContextInline))
{
this.scallContext = (string) IOUtil.ReadWithCode(input);
LogicalCallContext context = new LogicalCallContext {
RemotingData = { LogicalCallID = this.scallContext }
};
this.callContext = context;
}
if (IOUtil.FlagTest(this.messageEnum, MessageEnum.ArgsInline))
{
this.args = IOUtil.ReadArgs(input);
}
}
示例14: SerializeContextElements
private void SerializeContextElements(CdrOutputStream targetStream,
LogicalCallContext callContext,
Serializer contextElementSer) {
// if no context elements specified, don't serialise a context sequence.
if (m_contextElementKeys.Length > 0) {
string[] contextSeq = new string[m_contextElementKeys.Length * 2];
for (int i = 0; i < m_contextElementKeys.Length; i++) {
string contextKey =
m_contextElementKeys[i];
contextSeq[i * 2] = contextKey;
if (callContext.GetData(contextKey) != null) {
contextSeq[i * 2 + 1] = callContext.GetData(contextKey).ToString();
} else {
contextSeq[i * 2 + 1] = "";
}
}
contextElementSer.Serialize(contextSeq, targetStream);
}
}
示例15: BinaryMethodCallMessage
internal BinaryMethodCallMessage(String uri, String methodName, String typeName, Object[] args, Object methodSignature, LogicalCallContext callContext, Object[] properties)
{
_methodName = methodName;
_typeName = typeName;
//_uri = uri;
if (args == null)
args = new Object[0];
_inargs = args;
_args = args;
_methodSignature = methodSignature;
if (callContext == null)
_logicalCallContext = new LogicalCallContext();
else
_logicalCallContext = callContext;
_properties = properties;
}