Author: atsushi
Date: 2006-11-01 14:46:55 -0500 (Wed, 01 Nov 2006)
New Revision: 67229

Modified:
   branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs
Log:
2006-11-01  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * XmlAttributeEventArgs.cs : added ExpectedAttributes. Note that it
          is not considered in XmlSerializationReader yet.
        * XmlElementEventArgs.cs : added ExpectedElements. Note that it
          is not considered in XmlSerializationReader yet.
        * XmlSerializationReader.cs : added some overloads for 
          UnknownElement()/-Attribute()/-Node().



Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
===================================================================
--- branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/ChangeLog    
2006-11-01 19:45:33 UTC (rev 67228)
+++ branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/ChangeLog    
2006-11-01 19:46:55 UTC (rev 67229)
@@ -1,3 +1,33 @@
+2006-11-01  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * XmlAttributeEventArgs.cs : added ExpectedAttributes. Note that it
+         is not considered in XmlSerializationReader yet.
+       * XmlElementEventArgs.cs : added ExpectedElements. Note that it
+         is not considered in XmlSerializationReader yet.
+       * XmlSerializationReader.cs : added some overloads for 
+         UnknownElement()/-Attribute()/-Node().
+
+2006-11-01  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * CodeGenerationOptions.cs : [XmlEnum], [XmlIgnore] and
+         [Serializable].
+       * XmlSerializationCollectionFixupCallback.cs,
+         XmlNodeEventHandler.cs,
+         XmlSerializationReadCallback.cs,
+         UnreferencedObjectEventHandler.cs,
+         XmlSerializationWriteCallback.cs,
+         XmlAttributeEventHandler.cs,
+         XmlElementEventHandler.cs,
+         XmlSerializationFixupCallback.cs :
+         exclude [Serializable] in NET_2_0.
+       * XmlSerializerNamespaces.cs : removed beta-only AddInternal().
+       * XmlSerializerVersionAttribute.cs : removed [Obsolete].
+       * XmlMappingAccess.cs : it is [Flags].
+       * SchemaImporter.cs : implement Extensions.
+       * XmlAnyElementAttribute.cs,
+         XmlArrayAttribute.cs : added Order.
+         Note that it is not considered in XmlSerializer yet.
+
 2006-10-25  Ankit Jain  <[EMAIL PROTECTED]>
 
        * SerializationCodeGenerator.cs (GenerateContract): Handle

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs
     2006-11-01 19:45:33 UTC (rev 67228)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs
     2006-11-01 19:46:55 UTC (rev 67229)
@@ -42,6 +42,7 @@
                private int lineNumber;
                private int linePosition;
                private object obj;
+               private string expectedAttributes;
 
                internal XmlAttributeEventArgs(XmlAttribute attr, int lineNum, 
int linePos, object source)
                {
@@ -66,5 +67,12 @@
                public object ObjectBeingDeserialized {
                        get{ return obj; }
                }
+
+#if NET_2_0
+               public string ExpectedAttributes {
+                       get { return expectedAttributes; }
+                       internal set { expectedAttributes = value; }
+               }
+#endif
        }
 }

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs
       2006-11-01 19:45:33 UTC (rev 67228)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs
       2006-11-01 19:46:55 UTC (rev 67229)
@@ -42,6 +42,7 @@
                private int lineNumber;
                private int linePosition;
                private object obj;
+               private string expectedElements;
 
                internal XmlElementEventArgs(XmlElement attr, int lineNum, int 
linePos, object source)
                {
@@ -70,5 +71,12 @@
                {
                        get{ return obj; }
                }
+
+#if NET_2_0
+               public string ExpectedElements {
+                       get { return expectedElements; }
+                       internal set { expectedElements = value; }
+               }
+#endif
        }
 }

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs
    2006-11-01 19:45:33 UTC (rev 67228)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs
    2006-11-01 19:46:55 UTC (rev 67229)
@@ -40,6 +40,9 @@
 
 namespace System.Xml.Serialization 
 {
+#if NET_2_0
+       [MonoTODO ("provide expected elements/attributes on unknown 
elements/attributs")]
+#endif
        public abstract class XmlSerializationReader 
 #if NET_2_0
                : XmlSerializationGeneratedCode
@@ -717,7 +720,7 @@
                                XmlNode node = Document.ReadNode (reader);
                                
                                if (reportUnknown)
-                                       OnUnknownNode (node, null);
+                                       OnUnknownNode (node, null, null);
 
                                if (node.ChildNodes.Count == 0 && 
node.Attributes.Count == 0)
                                        return new Object ();
@@ -875,6 +878,14 @@
 
                protected void UnknownAttribute (object o, XmlAttribute attr)
                {
+                       UnknownAttribute (o, attr, null);
+               }
+
+#if NET_2_0
+               protected
+#endif
+               void UnknownAttribute (object o, XmlAttribute attr, string 
qnames)
+               {
                        int line_number, line_position;
                        
                        if (Reader is XmlTextReader){
@@ -885,12 +896,25 @@
                                line_position = 0;
                        }
 
+                       XmlAttributeEventArgs args = new XmlAttributeEventArgs 
(attr, line_number, line_position, o);
+#if NET_2_0
+                       args.ExpectedAttributes = qnames;
+#endif
+
                        if (eventSource != null)
-                               eventSource.OnUnknownAttribute (new 
XmlAttributeEventArgs (attr, line_number, line_position, o));
+                               eventSource.OnUnknownAttribute (args);
                }
 
                protected void UnknownElement (object o, XmlElement elem)
                {
+                       UnknownElement (o, elem, null);
+               }
+
+#if NET_2_0
+               protected
+#endif
+               void UnknownElement (object o, XmlElement elem, string qnames)
+               {
                        int line_number, line_position;
                        
                        if (Reader is XmlTextReader){
@@ -900,17 +924,30 @@
                                line_number = 0;
                                line_position = 0;
                        }
-       
+
+                       XmlElementEventArgs args = new XmlElementEventArgs 
(elem, line_number, line_position, o);
+#if NET_2_0
+                       args.ExpectedElements = qnames;
+#endif
+
                        if (eventSource != null)
-                               eventSource.OnUnknownElement (new 
XmlElementEventArgs (elem, line_number, line_position,o));
+                               eventSource.OnUnknownElement (args);
                }
 
                protected void UnknownNode (object o)
                {
-                       OnUnknownNode (ReadXmlNode (false), o);
+                       UnknownNode (o, null);
                }
+
+#if NET_2_0
+               protected
+#endif
+               void UnknownNode (object o, string qnames)
+               {
+                       OnUnknownNode (ReadXmlNode (false), o, qnames);
+               }
                
-               void OnUnknownNode (XmlNode node, object o)
+               void OnUnknownNode (XmlNode node, object o, string qnames)
                {
                        int line_number, line_position;
                        
@@ -924,12 +961,12 @@
        
                        if (node is XmlAttribute)
                        {
-                               UnknownAttribute (o, (XmlAttribute)node);
+                               UnknownAttribute (o, (XmlAttribute)node, 
qnames);
                                return;
                        }
                        else if (node is XmlElement)
                        {
-                               UnknownElement (o, (XmlElement) node);
+                               UnknownElement (o, (XmlElement) node, qnames);
                                return;
                        }
                        else

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to