//
// (C) 2003, Lluis Sanchez Gual
//\r
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
\r
using System;\r
using System.IO;\r
{\r
internal class MessageFormatter\r
{\r
- public static void WriteMethodCall (BinaryWriter writer, object obj, Header[] headers, ISurrogateSelector surrogateSelector, StreamingContext context, FormatterAssemblyStyle assemblyFormat)\r
+ public static void WriteMethodCall (BinaryWriter writer, object obj, Header[] headers, ISurrogateSelector surrogateSelector, StreamingContext context, FormatterAssemblyStyle assemblyFormat, FormatterTypeStyle typeFormat)\r
{\r
IMethodCallMessage call = (IMethodCallMessage)obj;\r
writer.Write ((byte) BinaryElement.MethodCall);\r
\r
if (info != null)\r
{\r
- ObjectWriter objectWriter = new ObjectWriter (surrogateSelector, context, assemblyFormat);\r
+ ObjectWriter objectWriter = new ObjectWriter (surrogateSelector, context, assemblyFormat, typeFormat);\r
objectWriter.WriteObjectGraph (writer, info, headers);\r
}\r
else\r
writer.Write ((byte) BinaryElement.End);\r
}\r
\r
- public static void WriteMethodResponse (BinaryWriter writer, object obj, Header[] headers, ISurrogateSelector surrogateSelector, StreamingContext context, FormatterAssemblyStyle assemblyFormat)\r
+ public static void WriteMethodResponse (BinaryWriter writer, object obj, Header[] headers, ISurrogateSelector surrogateSelector, StreamingContext context, FormatterAssemblyStyle assemblyFormat, FormatterTypeStyle typeFormat)\r
{\r
IMethodReturnMessage resp = (IMethodReturnMessage)obj;\r
writer.Write ((byte) BinaryElement.MethodResponse);\r
formatFlag = MethodFlags.NoArguments;\r
else \r
{\r
- if (AllTypesArePrimitive (resp.OutArgs)) \r
+ if (AllTypesArePrimitive (resp.Args)) \r
formatFlag = MethodFlags.PrimitiveArguments;\r
else \r
{\r
\r
if (formatFlag == MethodFlags.PrimitiveArguments)\r
{\r
- writer.Write ((uint)resp.OutArgCount);\r
- for (int n=0; n<resp.OutArgCount; n++)\r
+ writer.Write ((uint)resp.ArgCount);\r
+ for (int n=0; n<resp.ArgCount; n++)\r
{\r
- object val = resp.GetOutArg(n);\r
+ object val = resp.GetArg(n);\r
if (val != null) {\r
writer.Write (BinaryCommon.GetTypeCode (val.GetType()));\r
ObjectWriter.WritePrimitiveValue (writer, val);\r
int n = 0;\r
\r
if (formatFlag == MethodFlags.ArgumentsInMultiArray)\r
- infoArray[n++] = resp.OutArgs;\r
+ infoArray[n++] = resp.Args;\r
\r
if (returnTypeTag == ReturnTypeTag.ObjectType)\r
infoArray[n++] = resp.ReturnValue;\r
info = infoArray;\r
}\r
else if ((formatFlag & MethodFlags.ArgumentsInSimpleArray) > 0)\r
- info = resp.OutArgs;\r
+ info = resp.Args;\r
\r
if (info != null)\r
{\r
- ObjectWriter objectWriter = new ObjectWriter (surrogateSelector, context, assemblyFormat);\r
+ ObjectWriter objectWriter = new ObjectWriter (surrogateSelector, context, assemblyFormat, typeFormat);\r
objectWriter.WriteObjectGraph (writer, info, headers);\r
}\r
else\r
if (((BinaryTypeCode)reader.ReadByte()) != BinaryTypeCode.String) throw new SerializationException ("Invalid format");\r
string className = reader.ReadString();\r
\r
- bool hasContextInfo = (flags & MethodFlags.IncludesLogicalCallContext) > 0;
+ //bool hasContextInfo = (flags & MethodFlags.IncludesLogicalCallContext) > 0;
object[] arguments = null;
object methodSignature = null;