Commit Graph
476 Commits
Author SHA1 Message Date
scott fluto 207ce0bccc [708178] - Type check invalid and breaks XmlSerialization if serializing ICollection<> types 2011-07-28 15:19:43 -06:00
Atsushi Eno 4fab2dc4c3 Fix bug #703910 - implement Order support in XmlSerializer. 2011-07-21 04:57:32 +09:00
Atsushi Eno 2cc686a3af Fix bug 704813: just ignore members of type IEnumerable`1 without Add(). 2011-07-16 06:48:41 -07:00
Atsushi Eno 01308ef4ea Add test for XmlMembersMapping.TypeName and .Namespace (not very useful yet...) 2011-05-27 17:29:05 +09:00
Atsushi Eno 1550d9831a Check invalid recursion of xs:group use. Fixed bug #650117. 2011-05-18 01:09:21 +09:00
Atsushi Eno e1f4f82a0a Do not import xs:any member as XmlElement[]. Create a wrapper class instead.
Part of bugfix #670945.
2011-05-16 18:45:08 +09:00
Lluis Sanchez 3175239e84 [Web Services] Fix regression caused by previous commit
Fixes a regression caused by the implementation of support
for optional parameters. GlobalIndex was not being set
when using SOAP RPC protocol.
2011-05-06 18:39:51 +02:00
Sebastien Pouliot 4925054bb0 Make some S.X.S types compatible with the SL API (for SDK)
* XmlAnyElementAttributes.cs:
* XmlArrayItemAttributes.cs:
* XmlElementAttributes.cs:
	Under Silverlight API this implement IList only (does not
inherit from CollectionBase).

* XmlCustomFormatter.cs:
* XmlSerializationWriterInterpreter.cs:
	Use a Convert.ChangeType override that exists in SL API

* XmlReflectionImporter.cs: Provide an alternative for (missing in SL)
Enum.GetNames and select available (in SL) overloads for parsing and
formatting for enums

* XmlSerializationReader.cs: Fix ToEnum API to use IDictionary (in SL)
instead of Hashtable (even if the SL4 docs still states the later)

* XmlSerializationReaderInterpreter.cs:
* XmlTypeMapping.cs:
	Use the default (identical to nonPublic being false) when using
	Activator.CreateInstance under SL

* XmlSerializationWriter.cs: Internally use a Queue<T> instead a a Queue
(not available in SL). Also Namespaces (ArrayList) is replaced by
XmlNamespaces (IList) in SL API.

* XmlSerializer.cs: Do not use environment variables in MOONLIGHT (like
the rest of MOBILE). Use Encoding.UTF8 instead of ENcoding.Default since
the later does not exist in SL.

* XmlSerializerImplementation.cs: SL version use IDictionary instead of
Hashtable for properties.

* XmlSerializerNamespaces.cs: Internally use a generic Dictionary
* instead
of a ListDictionary (which is not available in SL)
2011-05-06 08:40:41 -04:00
Lluis Sanchez a8aa1e0653 [Web.Services] Add support for optional parameters
Non-nullable web service parameters can be made optional by
adding an additional parameter with the same name and a
'Specified' suffix. This was supported when serializing
classes, but not when serializing web service parameters.
This might fix bug 688496.
2011-04-28 18:33:59 +02:00
Atsushi Eno 2f86157982 XmlSerializer code generator was generating wrong char literal.
Fixed bug #673019.
2011-04-28 15:41:27 +09:00
Atsushi Eno 8fe0d1c078 Prepare for new System.Xml.Serialization.dll build (moonlight sdk assembly). 2011-04-15 15:00:40 +09:00
Lluis Sanchez 0943712481 Fix several issues in the code generator
Issues include: casts not being properly generated for nullable
types, missing cast when the type of a member does not match
the forced serialization type, and incorrect code generated
for handling [XmlText] members.
2010-12-13 16:51:44 +01:00
Lluis Sanchez 0dcc87e549 Fix code generation issue with nested generic types
The type argument list for generic nested types include
all types arguments for the whole declaring type chain.
When generating the C# name of the class, each type
argument has to be assigned to the correct class in
the chain.
2010-12-13 13:49:35 +01:00
Lluis Sanchez 3dc10b0fd1 Throw correct exceptions when using generated serializer
Invocations to generated serializers are done through
reflection, so exceptions are masked by TargetInvocationException.
The inner exception has to be rethrown so that the client
code gets the correct exception.
2010-12-13 13:49:34 +01:00
Jb Evain b2b1e43507 Fix the monodroid and monotouch profile builds 2010-09-08 18:48:36 +02:00
Jb Evain 0253e041a7 Enable the System.Xml build for monodroid 2010-09-08 18:48:29 +02:00
Raja R Harinath b293948fb7 EOL handling
This set of .gitattributes was automatically generated from the list of files
that GIT tried to normalize when I enabled automatic EOL conversion.

With this set of attributes, we prevent automated EOL conversion on files that
we know will cause trouble down the road.
2010-07-25 20:17:39 +05:30
Atsushi Eno 6e5c07fd59 2010-03-29 Atsushi Enomoto <[email protected]>
* XmlTypeMapping.cs, XmlReflectionImporter.cs: XmlRoot takes higher
	  priority to XmlSchemaProvider QName.
	  This fixes WCF EndpointAddress serialization.

	* XmlSerializerTests.cs : test for XmlRoot and XmlSchemaProvider
	  QName conflict case.


svn path=/trunk/mcs/; revision=154368
2010-03-29 12:48:29 +00:00
Jb Evain 846150badd use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153673
2010-03-16 12:31:23 +00:00
Atsushi Eno 1770b033b6 2010-03-10 Atsushi Enomoto <[email protected]>
* XmlAnyElementAttribute.cs : add internal IsNullableSpecified
	  (for moonlight compatibility).
	* XmlChoiceIdentifierAttribute.cs : implement MemberInfo (ditto).


svn path=/trunk/mcs/; revision=153394
2010-03-10 10:32:21 +00:00
Atsushi Eno 95aee05170 2010-03-08 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : namespaces argument could be null.
	  MS generated serializers often pass null here.


svn path=/trunk/mcs/; revision=153250
2010-03-08 12:42:52 +00:00
Atsushi Eno 0f1cffee4c 2010-01-28 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs : generate valid code for non-
	  identifier names. This should fix bug #488293.


svn path=/trunk/mcs/; revision=150356
2010-01-28 08:36:05 +00:00
Atsushi Eno 2866de3175 2010-01-26 Atsushi Enomoto <[email protected]>
* XmlReflectionImporter.cs, SerializationCodeGenerator.cs,
	  XmlSerializationWriterInterpreter.cs: XmlAnyElementAttribute can be
	  still used for non-XmlNode (object) array. It only fails when it
	  tries to serialize non-XmlNode object at run-time.
	  Fixed bug #553032.

	* XmlSerializerTests.cs : added test for bug #553032.


svn path=/trunk/mcs/; revision=150197
2010-01-26 07:06:51 +00:00
Atsushi Eno 6811013bfb 2010-01-06 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs : enum value identifiers should be
	  escaped with '@'. Fixed bug #566370.

	* XmlSerializerTests.cs : added test for #566370.


svn path=/trunk/mcs/; revision=149104
2010-01-06 04:02:02 +00:00
Jb Evain 561bf6b6b2 bring a net_2_0 feature set to monotouch
svn path=/trunk/mcs/; revision=140606
2009-08-25 10:18:20 +00:00
Atsushi Eno aef46c7bed 2009-03-13 Atsushi Enomoto <[email protected]>
* XmlRootAttribute.cs : it is also expected to have
          internal property for SL2.



svn path=/trunk/mcs/; revision=129290
2009-03-13 15:22:10 +00:00
Atsushi Eno ed25b28b95 2009-03-13 Atsushi Enomoto <[email protected]>
* XmlArrayItemAttribute.cs, XmlElementAttribute.cs,
	  XmlAnyElementAttribute.cs : added more 2.1 obstacles.


svn path=/trunk/mcs/; revision=129247
2009-03-13 07:28:04 +00:00
Atsushi Eno 00eeda36b0 2009-03-13 Atsushi Enomoto <[email protected]>
* XmlChoiceIdentifierAttribute.cs : added internal MemberInfo
	  property for SL2.


svn path=/trunk/mcs/; revision=129245
2009-03-13 07:16:28 +00:00
Atsushi Eno 019345956c 2009-03-13 Atsushi Enomoto <[email protected]>
* SerializationSource.cs, KeyHelper.cs : split out KeyHelper from
	  SerializationSource as the class is going to be used in 2.1 too.
	* XmlRootAttribute.cs : use KeyHelper above to add internal Key
	  property that is used in SL2 System.Xml.Serialization.dll.

	* System.Xml.dll.sources, net_2_1_raw_System.Xml.dll.sources :
	  added KeyHelper.cs.


svn path=/trunk/mcs/; revision=129243
2009-03-13 06:59:28 +00:00
Geoff Norton 869f7efb5f 2009-02-19 Geoff Norton <[email protected]>
* SerializationSource.cs: KeyHelper is needed by
        the 2.1 profile now.

svn path=/trunk/mcs/; revision=127368
2009-02-19 05:46:05 +00:00
Atsushi Eno c88cc51658 2009-01-22 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : hack ImportSchemaType().


svn path=/trunk/mcs/; revision=124164
2009-01-22 04:55:40 +00:00
Gonzalo Paniagua Javier 070f6cbea3 2008-12-10 Gonzalo Paniagua Javier <[email protected]>
* XmlSerializer.cs: updated to work with shadowcopy fixes.


svn path=/trunk/mcs/; revision=121275
2008-12-11 04:19:05 +00:00
Atsushi Eno ae6c7511d1 Fix for bug #430759.
svn path=/trunk/mcs/; revision=117965
2008-11-05 11:54:29 +00:00
Atsushi Eno 11ab97e09f 2008-09-19 Atsushi Enomoto <[email protected]>
* XmlSerializer.cs : revert previous change and fix sys.data tests.


svn path=/trunk/mcs/; revision=113521
2008-09-19 12:47:57 +00:00
Atsushi Eno 0f484f3d35 2008-09-17 Atsushi Enomoto <[email protected]>
* XmlSerializer.cs : in 2.0 profile it seems to create XmlReader
	  for stream and textreader, that skips whitespaces.


svn path=/trunk/mcs/; revision=113307
2008-09-17 13:29:18 +00:00
Atsushi Eno dfa3a04f22 2008-09-02 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs
	  XmlSerializationWriterInterpreter.cs : fixed bug #419973.
	  Sometimes implicit operators could involve and it affects on
	  typecasting. It's simple for code generator, but very bad for
	  reflection.

	* XmlSerializerTestClasses.cs, XmlSerializerTests.cs:
	  added test for bug #419973.


svn path=/trunk/mcs/; revision=112103
2008-09-02 16:56:08 +00:00
Marek Safar cc96a40c48 Warnings cleanup
svn path=/trunk/mcs/; revision=111909
2008-08-29 12:02:25 +00:00
Marek Safar 95a6e77b85 Warnings cleanup
svn path=/trunk/mcs/; revision=111839
2008-08-28 16:53:31 +00:00
Jb Evain 24fddc33da sl2b2 update
svn path=/trunk/mcs/; revision=110955
2008-08-19 16:26:20 +00:00
Atsushi Eno c470cdae3f 2008-07-10 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : more helpful error message.


svn path=/trunk/mcs/; revision=107645
2008-07-10 14:32:47 +00:00
Atsushi Eno 92573b4266 2008-07-09 Atsushi Enomoto <[email protected]>
* MapCodeGenerator.cs : use explicit element name for explicitly added
	  XmlElementAttribute. (exposed by some product from some company.)


svn path=/trunk/mcs/; revision=107530
2008-07-09 10:52:10 +00:00
Atsushi Eno 8688f906c3 2008-06-05 Atsushi Enomoto <[email protected]>
* XmlSerializationReaderInterpreter.cs, MapCodeGenerator.cs,
	  SerializationCodeGenerator.cs : fixed bug #378696.
	  Default value should not be filled during deserialization, and
	  default values for DateTime/TimeSpan/DateTimeOffset should not be
	  output as raw string in generated code.

	* XmlSerializerTestClasses.cs, DeserializeTests.cs,
	  ComplexDataStructure.cs : added test for bug #378696.
	  Fixed couple of wrong tests that expects default values filled
	  during deserialization.


svn path=/trunk/mcs/; revision=104983
2008-06-05 11:28:51 +00:00
Atsushi Eno 11f165cf56 2008-06-04 Atsushi Enomoto <[email protected]>
* XmlSerializationReader.cs : in ReadXmlDocument(), MoveToContent()
	  is required after ReadStartElement(). Fixed bug #393406 (without
	  unit test; no simple way to do that :( ).


svn path=/trunk/mcs/; revision=104846
2008-06-04 10:12:51 +00:00
Atsushi Eno da257a4cbb 2008-04-11 Atsushi Enomoto <[email protected]>
* XmlTypeMapping.cs : .NET 2.0 has a weird behavior that swallows
	  exception from IXmlSerializable.GetSchema().

	* XmlSerializerTestClasses.cs, XmlSerializerTests.cs : added test
	for IXmlSerializable serialization whose GetSchema() borks.


svn path=/trunk/mcs/; revision=100415
2008-04-11 06:34:35 +00:00
Lluis Sanchez 9dc8e1d48a * TypeData.cs: Prefix with a '@' type names that are equal to keywords.
* XmlSerializationReaderInterpreter.cs,
  XmlSerializationWriterInterpreter.cs: Properly handle nullable enum
  values.
* SerializationCodeGenerator.cs: Properly handle nullable enum values.
  Don't generate read flags for text collectors (avoid var not used
  warning).
* XmlReflectionImporter.cs: Assign the MappedType to text collector
  members. It is needed when the member is an enum.

svn path=/trunk/mcs/; revision=99512
2008-04-01 14:18:44 +00:00
Gert Driesen b10e9acc58 * 82078.xsd: Added new complex type as test for duplicate field
name.
* MapCodeGenerator.cs: Ensure fields that back properties are unique.
* XmlSerializationReaderTests.cs: Marked HandleOutAttributeParameters 
test as NotDotNet on 1.0 profile.
* XmlCodeExporterTests.cs: Improved test for duplicate identifiers.
Fixed ExportTypeMapping_Root and ExportTypeMapping_Field tests to
pass on .NET 2.0.

svn path=/trunk/mcs/; revision=99345
2008-03-30 15:25:11 +00:00
Lluis Sanchez 920e61fefd * MapCodeGenerator.cs, XmlTypeMapMember.cs, XmlTypeMapMemberElement.cs:
If a value type field has the IsNullable property set to true,
  generate it as System.Nullable<T>.

svn path=/trunk/mcs/; revision=99045
2008-03-26 17:34:17 +00:00
Lluis Sanchez 3b8d404393 * XmlSchemaImporter.cs: Fix problem with primitive types with a forced
base class. It happens for example when a web service declares a
  soap header of type bool. The schema exporter needs to generate a
  subclass of SoapHeader for that header type. But if bool is used in
  the parameters, it must use System.Boolean, not the SoapHeader
  subclass. The solution is to store primitive types with a forced
  base class in a different table. In this way it is possible to have
  two maps for primitive types: one with the forced base class
  (returned by ImportDerivedTypeMapping) and one with the regular
  primitive map. Fixes bug #336739.

svn path=/trunk/mcs/; revision=99013
2008-03-26 11:33:13 +00:00
Atsushi Eno 8f7afecbe1 2008-03-21 Atsushi Enomoto <[email protected]>
* XmlReflectionImporter.cs : set key for imported type mapping so
	  that generated serializer does not result in duplicate key error.
	  Fixed bug #372780.


svn path=/trunk/mcs/; revision=98729
2008-03-21 12:11:42 +00:00
Arina Itkes 5768c0f761 Fix of formatting.
svn path=/trunk/mcs/; revision=94728
2008-02-04 08:36:31 +00:00