Author: atsushi
Date: 2007-09-27 11:36:14 -0400 (Thu, 27 Sep 2007)
New Revision: 86507
Modified:
trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs
Log:
2007-09-27 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlMapping.cs : added XsdElementName.
* XmlSerializationWriter.cs : some more implementation.
Modified: trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
2007-09-27 15:32:27 UTC (rev 86506)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
2007-09-27 15:36:14 UTC (rev 86507)
@@ -1,3 +1,8 @@
+2007-09-27 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * XmlMapping.cs : added XsdElementName.
+ * XmlSerializationWriter.cs : some more implementation.
+
2007-09-25 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlTypeMapping.cs : Namespace and XmlTypeNamespace could be
Modified: trunk/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs
2007-09-27 15:32:27 UTC (rev 86506)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs
2007-09-27 15:36:14 UTC (rev 86507)
@@ -59,6 +59,12 @@
}
#if NET_2_0
+ [MonoTODO]
+ public string XsdElementName
+ {
+ get { return _elementName; }
+ }
+
public string ElementName
{
get { return _elementName; }
Modified:
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs
===================================================================
---
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs
2007-09-27 15:32:27 UTC (rev 86506)
+++
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationWriter.cs
2007-09-27 15:36:14 UTC (rev 86507)
@@ -756,16 +756,26 @@
protected void WriteSerializable (IXmlSerializable
serializable, string name, string ns, bool isNullable)
{
+ WriteSerializable (serializable, name, ns, isNullable,
true);
+ }
+
+#if NET_2_0
+ protected
+#endif
+ void WriteSerializable (IXmlSerializable serializable, string
name, string ns, bool isNullable, bool wrapped)
+ {
if (serializable == null)
{
- if (isNullable) WriteNullTagLiteral (name, ns);
+ if (isNullable && wrapped) WriteNullTagLiteral
(name, ns);
return;
}
else
{
- Writer.WriteStartElement (name, ns);
+ if (wrapped)
+ Writer.WriteStartElement (name, ns);
serializable.WriteXml (Writer);
- Writer.WriteEndElement ();
+ if (wrapped)
+ Writer.WriteEndElement ();
}
}
@@ -797,6 +807,20 @@
protected void WriteStartElement (string name, string ns,
object o, bool writePrefixed)
{
+ WriteStartElement (name, ns, o, writePrefixed,
namespaces);
+ }
+
+#if NET_2_0
+ protected void WriteStartElement (string name, string ns,
Object o, bool writePrefixed, XmlSerializerNamespaces xmlns)
+ {
+ if (xmlns == null)
+ throw new ArgumentNullException ("xmlns");
+ WriteStartElement (name, ns, o, writePrefixed,
xmlns.ToArray ());
+ }
+#endif
+
+ void WriteStartElement (string name, string ns, object o, bool
writePrefixed, ICollection namespaces)
+ {
if (o != null)
{
if (serializedObjects.Contains (o))
@@ -844,14 +868,6 @@
}
}
-#if NET_2_0
- [MonoNotSupported("")]
- protected void WriteStartElement (string name, string ns,
Object o, bool writePrefixed, XmlSerializerNamespaces xmlns)
- {
- throw new NotImplementedException ();
- }
-#endif
-
protected void WriteTypedPrimitive (string name, string ns,
object o, bool xsiType)
{
string value;
@@ -931,16 +947,17 @@
#if NET_2_0
- [MonoTODO]
protected Exception CreateInvalidAnyTypeException (object o)
{
- throw new NotImplementedException ();
+ if (o == null)
+ return new InvalidOperationException ("null is
invalid as anyType in XmlSerializer");
+ else
+ return CreateInvalidAnyTypeException (o.GetType
());
}
- [MonoTODO]
protected Exception CreateInvalidAnyTypeException (Type t)
{
- throw new NotImplementedException ();
+ return new InvalidOperationException (String.Format
("An object of type '{0}' is invalid as anyType in XmlSerializer", t));
}
protected Exception CreateInvalidEnumValueException (object
value, string typeName)
@@ -967,12 +984,6 @@
}
[MonoTODO]
- protected void WriteSerializable (IXmlSerializable
serializable, string name, string ns, bool isNullable, bool any)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
protected bool EscapeName
{
get { throw new NotImplementedException(); }
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches