namespace System.Runtime.Remoting.Messaging
{
+#if NET_2_0
+ [System.Runtime.InteropServices.ComVisible (true)]
+#endif
public class ReturnMessage : IMethodReturnMessage, IMethodMessage, IMessage, IInternalMessage
{
object[] _outArgs;
_args = outArgs;
_outArgsCount = outArgCount;
_callCtx = callCtx;
- _uri = request.Uri;
- _methodBase = request.MethodBase;
+ if (request != null) {
+ _uri = request.Uri;
+ _methodBase = request.MethodBase;
+ }
if (_args == null) _args = new object [outArgCount];
}
{
_exception = exc;
- if (request != null)
+ if (request != null) {
_methodBase = request.MethodBase;
+ _callCtx = request.LogicalCallContext;
+ }
_args = new object[0]; // .NET does this
}
public bool HasVarArgs {
get {
- return (MethodBase.CallingConvention | CallingConventions.VarArgs) != 0;
+ if (_methodBase == null) return false;
+ else return (_methodBase.CallingConvention | CallingConventions.VarArgs) != 0;
}
}
public LogicalCallContext LogicalCallContext {
get {
+ if (_callCtx == null)
+ _callCtx = new LogicalCallContext ();
return _callCtx;
}
}
}
}
+ string IInternalMessage.Uri {
+ get { return Uri; }
+ set { Uri = value; }
+ }
+
public object GetArg (int arg_num)
{
return _args [arg_num];
set { _targetIdentity = value; }
}
+#if !NET_2_0
public override string ToString ()
{
string s = TypeName.Split(',')[0] + "." + MethodName + " (";
}
return s;
}
+#endif
}
}