Author: atsushi
Date: 2006-11-01 14:52:06 -0500 (Wed, 01 Nov 2006)
New Revision: 67230

Added:
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaEnumerator.cs
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerImplementation.cs
Removed:
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/IXmlSerializerImplementation.cs
Modified:
   branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/SerializationCodeGenerator.cs
   branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemas.cs
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationGeneratedCode.cs
   
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs
Log:
2006-11-01  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * XmlSerializationGeneratedCode.cs : removed InternalSyncObject.
        * SerializationCodeGenerator.cs : since IXmlSerializerImplementation
          became a class, it needs explicit "override".
          Since InternalSyncObject is gone, it needs another lock target.
        * IXmlSerializerImplementation.cs : removed.
        * XmlSerializerImplementation.cs : added.
        * XmlSerializer.cs : removed extra GenerateSerializer() overloads.
          IXmlSerializerImplementation -> XmlSerializerImplementation.
        * XmlSchemas.cs : removed Schemas. hacked Compile().
          Now it implements IEnumerable<XmlSchema>.
        * XmlSchemaEnumerator.cs : added missing type.



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:46:55 UTC (rev 67229)
+++ branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/ChangeLog    
2006-11-01 19:52:06 UTC (rev 67230)
@@ -1,5 +1,19 @@
 2006-11-01  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * XmlSerializationGeneratedCode.cs : removed InternalSyncObject.
+       * SerializationCodeGenerator.cs : since IXmlSerializerImplementation
+         became a class, it needs explicit "override".
+         Since InternalSyncObject is gone, it needs another lock target.
+       * IXmlSerializerImplementation.cs : removed.
+       * XmlSerializerImplementation.cs : added.
+       * XmlSerializer.cs : removed extra GenerateSerializer() overloads.
+         IXmlSerializerImplementation -> XmlSerializerImplementation.
+       * XmlSchemas.cs : removed Schemas. hacked Compile().
+         Now it implements IEnumerable<XmlSchema>.
+       * XmlSchemaEnumerator.cs : added missing type.
+
+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

Deleted: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/IXmlSerializerImplementation.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/IXmlSerializerImplementation.cs
      2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/IXmlSerializerImplementation.cs
      2006-11-01 19:52:06 UTC (rev 67230)
@@ -1,53 +0,0 @@
-// 
-// System.Xml.Serialization.IXmlSerializerImplementation.cs 
-//
-// Author:
-//   Lluis Sanchez Gual ([EMAIL PROTECTED])
-//
-// Copyright (C) Novell, Inc., 2004
-//
-
-//
-// 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.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml.Serialization 
-{
-#if NET_2_0
-       public
-#else
-       internal
-#endif
-       
-       interface IXmlSerializerImplementation
-       {
-               XmlSerializationReader Reader {get;}
-               Hashtable ReadMethods {get;}
-               Hashtable TypedSerializers {get;}
-               Hashtable WriteMethods {get;}
-               XmlSerializationWriter Writer {get;}
-               
-               bool CanSerialize (Type type);
-       }
-}
-

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/SerializationCodeGenerator.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/SerializationCodeGenerator.cs
        2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/SerializationCodeGenerator.cs
        2006-11-01 19:52:06 UTC (rev 67230)
@@ -328,7 +328,7 @@
                                WriteLine ("");
                        }
 
-                       WriteLine (access_mod + " class XmlSerializerContract : 
System.Xml.Serialization.IXmlSerializerImplementation");
+                       WriteLine (access_mod + " class XmlSerializerContract : 
System.Xml.Serialization.XmlSerializerImplementation");
                        WriteLineInd ("{");
                        
                        WriteLine ("System.Collections.Hashtable readMethods = 
null;");
@@ -336,23 +336,23 @@
                        WriteLine ("System.Collections.Hashtable 
typedSerializers = null;");
                        WriteLine ("");
                
-                       WriteLineInd ("public 
System.Xml.Serialization.XmlSerializationReader Reader {");
+                       WriteLineInd ("public override 
System.Xml.Serialization.XmlSerializationReader Reader {");
                        WriteLineInd ("get {");
                        WriteLine ("return new " + main.ReaderClassName + 
"();");
                        WriteLineUni ("}");
                        WriteLineUni ("}");
                        WriteLine ("");
                        
-                       WriteLineInd ("public 
System.Xml.Serialization.XmlSerializationWriter Writer {");
+                       WriteLineInd ("public override 
System.Xml.Serialization.XmlSerializationWriter Writer {");
                        WriteLineInd ("get {");
                        WriteLine ("return new " + main.WriterClassName + 
"();");
                        WriteLineUni ("}");
                        WriteLineUni ("}");
                        WriteLine ("");
                        
-                       WriteLineInd ("public System.Collections.Hashtable 
ReadMethods {");
+                       WriteLineInd ("public override 
System.Collections.Hashtable ReadMethods {");
                        WriteLineInd ("get {");
-                       WriteLineInd ("lock 
(System.Xml.Serialization.XmlSerializationGeneratedCode.InternalSyncObject) {");
+                       WriteLineInd ("lock (this) {");
                        WriteLineInd ("if (readMethods == null) {");
                        WriteLine ("readMethods = new 
System.Collections.Hashtable ();");
                        foreach (GenerationResult res in generatedMaps)
@@ -364,9 +364,9 @@
                        WriteLineUni ("}");
                        WriteLine ("");
                        
-                       WriteLineInd ("public System.Collections.Hashtable 
WriteMethods {");
+                       WriteLineInd ("public override 
System.Collections.Hashtable WriteMethods {");
                        WriteLineInd ("get {");
-                       WriteLineInd ("lock 
(System.Xml.Serialization.XmlSerializationGeneratedCode.InternalSyncObject) {");
+                       WriteLineInd ("lock (this) {");
                        WriteLineInd ("if (writeMethods == null) {");
                        WriteLine ("writeMethods = new 
System.Collections.Hashtable ();");
                        foreach (GenerationResult res in generatedMaps)
@@ -378,9 +378,9 @@
                        WriteLineUni ("}");
                        WriteLine ("");
                        
-                       WriteLineInd ("public System.Collections.Hashtable 
TypedSerializers {");
+                       WriteLineInd ("public override 
System.Collections.Hashtable TypedSerializers {");
                        WriteLineInd ("get {");
-                       WriteLineInd ("lock 
(System.Xml.Serialization.XmlSerializationGeneratedCode.InternalSyncObject) {");
+                       WriteLineInd ("lock (this) {");
                        WriteLineInd ("if (typedSerializers == null) {");
                        WriteLine ("typedSerializers = new 
System.Collections.Hashtable ();");
                        foreach (GenerationResult res in generatedMaps)
@@ -391,7 +391,7 @@
                        WriteLineUni ("}");
                        WriteLineUni ("}");
                        
-                       WriteLineInd ("public bool CanSerialize (System.Type 
type) {");
+                       WriteLineInd ("public override bool CanSerialize 
(System.Type type) {");
                        foreach (GenerationResult res in generatedMaps) {
                                if (res.Mapping is XmlTypeMapping)
                                        WriteLine ("if (type == typeof(" + 
(res.Mapping as XmlTypeMapping).TypeData.FullTypeName +  ")) return true;");

Added: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaEnumerator.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaEnumerator.cs
       2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaEnumerator.cs
       2006-11-01 19:52:06 UTC (rev 67230)
@@ -0,0 +1,73 @@
+// 
+// System.Xml.Serialization.XmlSerializerVersionAttribute.cs 
+//
+// Author:
+//   Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Novell, Inc.
+//
+
+//
+// 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.
+//
+
+#if NET_2_0
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Xml.Schema;
+
+namespace System.Xml.Serialization
+{
+       [MonoTODO]
+       public class XmlSchemaEnumerator : IEnumerator<XmlSchema>, IDisposable, 
IEnumerator
+       {
+               IEnumerator e;
+
+               public XmlSchemaEnumerator (XmlSchemas list)
+               {
+                       e = list.GetEnumerator ();
+               }
+
+               public XmlSchema Current {
+                       get { return (XmlSchema) e.Current; }
+               }
+
+               public void Dispose ()
+               {
+               }
+
+               public bool MoveNext ()
+               {
+                       return e.MoveNext ();
+               }
+
+               object IEnumerator.Current {
+                       get { return Current; }
+               }
+
+               void IEnumerator.Reset ()
+               {
+                       e.Reset ();
+               }
+       }
+}
+#endif


Property changes on: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaEnumerator.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemas.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemas.cs    
    2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSchemas.cs    
    2006-11-01 19:52:06 UTC (rev 67230)
@@ -29,10 +29,19 @@
 //
 
 using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
 using System.Xml.Schema;
 
-namespace System.Xml.Serialization {
-       public class XmlSchemas : CollectionBase {
+namespace System.Xml.Serialization
+{
+#if NET_2_0
+       public class XmlSchemas : CollectionBase, IEnumerable<XmlSchema>
+#else
+       public class XmlSchemas : CollectionBase
+#endif
+       {
 
                #region Fields
                private static string msdataNS = 
"urn:schemas-microsoft-com:xml-msdata";
@@ -73,14 +82,11 @@
                }
                
                [MonoTODO]
-               public ICollection Schemas 
-               {
-                       get { throw new NotImplementedException (); }
-               }
-               
-               [MonoTODO]
                public void Compile (ValidationEventHandler handler, bool 
fullCompile)
                {
+                       foreach (XmlSchema xs in this)
+                               if (fullCompile || !xs.IsCompiled)
+                                       xs.Compile (handler);
                }
 #endif
 
@@ -228,6 +234,13 @@
                        List.Remove (schema);
                }
 
+#if NET_2_0
+               IEnumerator<XmlSchema> IEnumerable<XmlSchema>.GetEnumerator ()
+               {
+                       return new XmlSchemaEnumerator (this);
+               }
+#endif
+
                #endregion // Methods
        }
 }

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationGeneratedCode.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationGeneratedCode.cs
     2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationGeneratedCode.cs
     2006-11-01 19:52:06 UTC (rev 67230)
@@ -36,17 +36,9 @@
 {
        public abstract class XmlSerializationGeneratedCode
        {
-               [MonoTODO]
                protected XmlSerializationGeneratedCode ()
                {
                }
-               
-               [MonoTODO]
-               public static object InternalSyncObject 
-               {
-                       get { throw new NotImplementedException(); }
-               }
-
        }
 }
 

Modified: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs 
    2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs 
    2006-11-01 19:52:06 UTC (rev 67230)
@@ -73,7 +73,7 @@
                        public Type WriterType;
                        public MethodInfo WriterMethod;
                        public GenerationBatch Batch;
-                       public IXmlSerializerImplementation Implementation = 
null;
+                       public XmlSerializerImplementation Implementation = 
null;
                        
                        public XmlSerializationReader CreateReader () {
                                if (ReaderType != null)
@@ -533,29 +533,6 @@
                }
 #endif
 
-               [MonoTODO]
-               [Obsolete]
-               public static Assembly GenerateSerializer (Type[] types, 
-                       XmlMapping[] mappings, 
-                       string codePath, 
-                       bool debug, 
-                       bool keepFiles)
-               {
-                       throw new NotImplementedException ();
-               }
-               
-               [MonoTODO]
-               [Obsolete]
-               public static Assembly GenerateSerializer (Type[] types, 
-                       XmlMapping[] mappings, 
-                       string codePath, 
-                       bool debug, 
-                       bool keepFiles, 
-                       string compilerOptions)
-               {
-                       throw new NotImplementedException ();
-               }
-
                public static string GetXmlSerializerAssemblyName (Type type)
                {
                        return type.Assembly.GetName().Name + ".XmlSerializers";

Added: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerImplementation.cs
===================================================================
--- 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerImplementation.cs
       2006-11-01 19:46:55 UTC (rev 67229)
+++ 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerImplementation.cs
       2006-11-01 19:52:06 UTC (rev 67230)
@@ -0,0 +1,69 @@
+// 
+// XmlSerializerImplementation.cs 
+//
+// Author:
+//   Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Novell, Inc.
+//
+
+//
+// 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.
+//
+
+using System;
+using System.Collections;
+
+namespace System.Xml.Serialization
+{
+#if NET_2_0
+       public
+#else
+       internal
+#endif
+       
+       abstract class XmlSerializerImplementation
+       {
+               public virtual XmlSerializationReader Reader {
+                       get { throw new NotSupportedException (); }
+               }
+               public virtual Hashtable ReadMethods {
+                       get { throw new NotSupportedException (); }
+               }
+               public virtual Hashtable TypedSerializers {
+                       get { throw new NotSupportedException (); }
+               }
+               public virtual Hashtable WriteMethods {
+                       get { throw new NotSupportedException (); }
+               }
+               public virtual XmlSerializationWriter Writer {
+                       get { throw new NotSupportedException (); }
+               }
+               public virtual bool CanSerialize (Type type)
+               {
+                       throw new NotSupportedException ();
+               }
+               public virtual XmlSerializer GetSerializer (Type type)
+               {
+                       throw new NotSupportedException ();
+               }
+       }
+}
+


Property changes on: 
branches/atsushi/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerImplementation.cs
___________________________________________________________________
Name: svn:eol-style
   + native

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

Reply via email to