Пример #1
0
        internal void Merge(LogicalCallContext lc)
        {
            if (lc == null || this == lc || !lc.HasUserData)
            {
                return;
            }
            IDictionaryEnumerator enumerator = lc.Datastore.GetEnumerator();

            while (enumerator.MoveNext())
            {
                this.Datastore[(object)(string)enumerator.Key] = enumerator.Value;
            }
        }
Пример #2
0
 internal MethodCall(SmuggledMethodCallMessage smuggledMsg, ArrayList deserializedArgs)
 {
     this.uri             = smuggledMsg.Uri;
     this.typeName        = smuggledMsg.TypeName;
     this.methodName      = smuggledMsg.MethodName;
     this.methodSignature = (Type[])smuggledMsg.GetMethodSignature(deserializedArgs);
     this.args            = smuggledMsg.GetArgs(deserializedArgs);
     this.instArgs        = smuggledMsg.GetInstantiation(deserializedArgs);
     this.callContext     = smuggledMsg.GetCallContext(deserializedArgs);
     this.ResolveMethod();
     if (smuggledMsg.MessagePropertyCount <= 0)
     {
         return;
     }
     smuggledMsg.PopulateMessageProperties(this.Properties, deserializedArgs);
 }
Пример #3
0
        public object Clone()
        {
            LogicalCallContext logicalCallContext = new LogicalCallContext();

            if (this.m_RemotingData != null)
            {
                logicalCallContext.m_RemotingData = (CallContextRemotingData)this.m_RemotingData.Clone();
            }
            if (this.m_SecurityData != null)
            {
                logicalCallContext.m_SecurityData = (CallContextSecurityData)this.m_SecurityData.Clone();
            }
            if (this.m_HostContext != null)
            {
                logicalCallContext.m_HostContext = this.m_HostContext;
            }
            logicalCallContext.m_IsCorrelationMgr = this.m_IsCorrelationMgr;
            if (this.HasUserData)
            {
                IDictionaryEnumerator enumerator = this.m_Datastore.GetEnumerator();
                if (!this.m_IsCorrelationMgr)
                {
                    while (enumerator.MoveNext())
                    {
                        logicalCallContext.Datastore[(object)(string)enumerator.Key] = enumerator.Value;
                    }
                }
                else
                {
                    while (enumerator.MoveNext())
                    {
                        string key = (string)enumerator.Key;
                        if (key.Equals("System.Diagnostics.Trace.CorrelationManagerSlot"))
                        {
                            logicalCallContext.Datastore[(object)key] = ((ICloneable)enumerator.Value).Clone();
                        }
                        else
                        {
                            logicalCallContext.Datastore[(object)key] = enumerator.Value;
                        }
                    }
                }
            }
            return((object)logicalCallContext);
        }
Пример #4
0
 internal MethodCall(object handlerObject, BinaryMethodCallMessage smuggledMsg)
 {
     if (handlerObject != null)
     {
         this.uri = handlerObject as string;
         if (this.uri == null && handlerObject is MarshalByRefObject marshalByRefObject2)
         {
             this.srvID = MarshalByRefObject.GetIdentity(marshalByRefObject2, out bool _) as ServerIdentity;
             this.uri   = this.srvID.URI;
         }
     }
     this.typeName        = smuggledMsg.TypeName;
     this.methodName      = smuggledMsg.MethodName;
     this.methodSignature = (Type[])smuggledMsg.MethodSignature;
     this.args            = smuggledMsg.Args;
     this.instArgs        = smuggledMsg.InstantiationArgs;
     this.callContext     = smuggledMsg.LogicalCallContext;
     this.ResolveMethod();
     if (!smuggledMsg.HasProperties)
     {
         return;
     }
     smuggledMsg.PopulateMessageProperties(this.Properties);
 }