Пример #1
0
 protected static object[] FixupArgs(object[] args, ref ArrayList argsToSerialize)
 {
     object[] objArray = new object[args.Length];
       int length = args.Length;
       for (int index = 0; index < length; ++index)
     objArray[index] = MessageSmuggler.FixupArg(args[index], ref argsToSerialize);
       return objArray;
 }
        protected static object[] FixupArgs(object[] args, ref ArrayList argsToSerialize)
        {
            object[] array = new object[args.Length];
            int      num   = args.Length;

            for (int i = 0; i < num; i++)
            {
                array[i] = MessageSmuggler.FixupArg(args[i], ref argsToSerialize);
            }
            return(array);
        }
Пример #3
0
        private SmuggledMethodReturnMessage(IMethodReturnMessage mrm)
        {
            ArrayList     argsToSerialize = (ArrayList)null;
            ReturnMessage returnMessage   = mrm as ReturnMessage;

            if (returnMessage == null || returnMessage.HasProperties())
            {
                this._propertyCount = MessageSmuggler.StoreUserPropertiesForMethodMessage((IMethodMessage)mrm, ref argsToSerialize);
            }
            Exception exception = mrm.Exception;

            if (exception != null)
            {
                if (argsToSerialize == null)
                {
                    argsToSerialize = new ArrayList();
                }
                this._exception = new MessageSmuggler.SerializedArg(argsToSerialize.Count);
                argsToSerialize.Add((object)exception);
            }
            LogicalCallContext logicalCallContext = mrm.LogicalCallContext;

            if (logicalCallContext == null)
            {
                this._callContext = (object)null;
            }
            else if (logicalCallContext.HasInfo)
            {
                if (logicalCallContext.Principal != null)
                {
                    logicalCallContext.Principal = (IPrincipal)null;
                }
                if (argsToSerialize == null)
                {
                    argsToSerialize = new ArrayList();
                }
                this._callContext = (object)new MessageSmuggler.SerializedArg(argsToSerialize.Count);
                argsToSerialize.Add((object)logicalCallContext);
            }
            else
            {
                this._callContext = (object)logicalCallContext.RemotingData.LogicalCallID;
            }
            this._returnValue = MessageSmuggler.FixupArg(mrm.ReturnValue, ref argsToSerialize);
            this._args        = MessageSmuggler.FixupArgs(mrm.Args, ref argsToSerialize);
            if (argsToSerialize == null)
            {
                return;
            }
            this._serializedArgs = CrossAppDomainSerializer.SerializeMessageParts(argsToSerialize).GetBuffer();
        }