Procházet zdrojové kódy

* SerializationCodeGenerator.cs, XmlSerializationReaderInterpreter.cs:
When deserializing an encoded method response, assign to the return value
the first element of the message, whatever it is. The return type doesn't
need to be Object, it seems to be true for all return types.

svn path=/trunk/mcs/; revision=32813

Lluis Sanchez před 21 roky
rodič
revize
c5d8d4e2bd

+ 7 - 0
mcs/class/System.XML/System.Xml.Serialization/ChangeLog

@@ -1,3 +1,10 @@
+2004-08-25  Lluis Sanchez Gual  <[email protected]>
+
+	* SerializationCodeGenerator.cs, XmlSerializationReaderInterpreter.cs: 
+	  When deserializing an encoded method response, assign to the return value
+	  the first element of the message, whatever it is. The return type doesn't
+	  need to be Object, it seems to be true for all return types.
+	  
 2004-07-26  Lluis Sanchez Gual  <[email protected]>
 
 	* MapCodeGenerator.cs: CreateFieldMember now adds the field to the class,

+ 1 - 1
mcs/class/System.XML/System.Xml.Serialization/SerializationCodeGenerator.cs

@@ -1667,7 +1667,7 @@ namespace System.Xml.Serialization
 						if (info.IsTextElement || info.IsUnnamedAnyElement) continue;
 						string elemCond = first ? "" : "else ";
 						elemCond += "if (";
-						if (!(info.Member.IsReturnValue && info.TypeData.Type == typeof(object) && _format == SerializationFormat.Encoded)) {
+						if (!(info.Member.IsReturnValue && _format == SerializationFormat.Encoded)) {
 							elemCond += "Reader.LocalName == " + GetLiteral (info.ElementName);
 							if (!map.IgnoreMemberNamespace) elemCond += " && Reader.NamespaceURI == " + GetLiteral (info.Namespace);
 							elemCond += " && ";

+ 1 - 2
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs

@@ -294,8 +294,7 @@ namespace System.Xml.Serialization
 
 			bool[] readFlag = new bool[(map.ElementMembers != null) ? map.ElementMembers.Count : 0];
 
-			bool hasAnyReturnMember = (isValueList && _format == SerializationFormat.Encoded && map.ReturnMember != null 
-										&& map.ReturnMember.TypeData.Type == typeof(object));
+			bool hasAnyReturnMember = (isValueList && _format == SerializationFormat.Encoded && map.ReturnMember != null);
 			
 			Reader.MoveToContent();