Browse Source

[xml] take out some types in Dummy.cs to better source files.

Atsushi Eno 10 years ago
parent
commit
751ecd3e5b

+ 7 - 0
mcs/build/common/SR.cs

@@ -9,7 +9,9 @@ static class AssemblyRef
 	public const string EcmaPublicKey = "b77a5c561934e089";
 	public const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
  
+ 	public const string MicrosoftJScript = Consts.AssemblyMicrosoft_JScript;
  	public const string MicrosoftVSDesigner = Consts.AssemblyMicrosoft_VSDesigner;
+	public const string SystemData = Consts.AssemblySystem_Data;
 	public const string SystemDesign = Consts.AssemblySystem_Design;
 	public const string SystemDrawing = Consts.AssemblySystem_Drawing;
 	public const string SystemWeb = Consts.AssemblySystem_Web;
@@ -17,6 +19,11 @@ static class AssemblyRef
 	public const string SystemWindowsForms = Consts.AssemblySystem_Windows_Forms;
 }
 
+static class ThisAssembly
+{
+	public const string Version = Consts.FxVersion;
+}
+
 static partial class SR
 {
 	internal static string GetString(string name, params object[] args)

+ 1 - 73
mcs/class/System.XML/Dummy.cs

@@ -24,79 +24,7 @@ namespace System.Xml.Utils
 	}
 }
 
-namespace System
-{
-	static class AssemblyRef
-	{
-		public const string MicrosoftJScript = "Microsoft.JScript";
-		public const string SystemData = "System.Data";
-	}
-
-	static class ThisAssembly
-	{
-		public const string Version = "System.Xml";
-	}
-}
-
-// Types within this namespace are taken from referencesource
-namespace System.Xml.Serialization
-{
-	//------------------------------------------------------------------------------
-	//     Copyright (c) Microsoft Corporation.  All rights reserved.
-	//------------------------------------------------------------------------------
-
-	// from Models.cs
-	internal enum SpecifiedAccessor {
-		None,
-		ReadOnly,
-		ReadWrite,
-	}
-
-	// from Types.cs
-	internal class TypeScope
-	{
-		static internal XmlQualifiedName ParseWsdlArrayType(string type, out string dims, XmlSchemaObject parent) {
-			string ns;
-			string name;
-
-			int nsLen = type.LastIndexOf(':');
-
-			if (nsLen <= 0) {
-				ns = "";
-			}
-			else {
-				ns = type.Substring(0, nsLen);
-			}
-			int nameLen = type.IndexOf('[', nsLen + 1);
-
-			if (nameLen <= nsLen) {
-				throw new InvalidOperationException(Res.GetString(Res.XmlInvalidArrayTypeSyntax, type));
-			}
-			name = type.Substring(nsLen + 1, nameLen - nsLen - 1);
-			dims = type.Substring(nameLen);
-
-			// parent is not null only in the case when we used XmlSchema.Read(), 
-			// in which case we need to fixup the wsdl:arayType attribute value
-			while (parent != null) {
-				if (parent.Namespaces != null) {
-					string wsdlNs = (string)parent.Namespaces.Namespaces[ns];
-					if (wsdlNs != null) {
-						ns = wsdlNs;
-						break;
-					}
-				}
-				parent = parent.Parent;
-			}
-			return new XmlQualifiedName(name, ns);
-		}
-	}
-	internal class Wsdl {
-		private Wsdl() { }
-		internal const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
-		internal const string ArrayType = "arrayType";
-	}
-}
-
+// workaround for missing members in corlib.
 namespace System.Security.Policy
 {
 	static class EvidenceExtensions

+ 9 - 0
mcs/class/System.XML/ReferenceSources/SpecifiedAccessor.cs

@@ -0,0 +1,9 @@
+namespace System.Xml.Serialization
+{
+	// from Models.cs
+	internal enum SpecifiedAccessor {
+		None,
+		ReadOnly,
+		ReadWrite,
+	}
+}

+ 50 - 0
mcs/class/System.XML/ReferenceSources/TypeScope.cs

@@ -0,0 +1,50 @@
+//------------------------------------------------------------------------------
+//     Copyright (c) Microsoft Corporation.  All rights reserved.
+//------------------------------------------------------------------------------
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Xml.Schema;
+
+namespace System.Xml.Serialization
+{
+	// from Types.cs
+	internal class TypeScope
+	{
+		static internal XmlQualifiedName ParseWsdlArrayType(string type, out string dims, XmlSchemaObject parent) {
+			string ns;
+			string name;
+
+			int nsLen = type.LastIndexOf(':');
+
+			if (nsLen <= 0) {
+				ns = "";
+			}
+			else {
+				ns = type.Substring(0, nsLen);
+			}
+			int nameLen = type.IndexOf('[', nsLen + 1);
+
+			if (nameLen <= nsLen) {
+				throw new InvalidOperationException(Res.GetString(Res.XmlInvalidArrayTypeSyntax, type));
+			}
+			name = type.Substring(nsLen + 1, nameLen - nsLen - 1);
+			dims = type.Substring(nameLen);
+
+			// parent is not null only in the case when we used XmlSchema.Read(), 
+			// in which case we need to fixup the wsdl:arayType attribute value
+			while (parent != null) {
+				if (parent.Namespaces != null) {
+					string wsdlNs = (string)parent.Namespaces.Namespaces[ns];
+					if (wsdlNs != null) {
+						ns = wsdlNs;
+						break;
+					}
+				}
+				parent = parent.Parent;
+			}
+			return new XmlQualifiedName(name, ns);
+		}
+	}
+}
+

+ 9 - 0
mcs/class/System.XML/ReferenceSources/Wsdl.cs

@@ -0,0 +1,9 @@
+namespace System.Xml.Serialization
+{
+	internal class Wsdl {
+		private Wsdl() { }
+		internal const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
+		internal const string ArrayType = "arrayType";
+	}
+}
+

+ 4 - 0
mcs/class/System.XML/System.Xml.dll.sources

@@ -2,10 +2,14 @@ Assembly/AssemblyInfo.cs
 ../../build/common/Consts.cs
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
+../../build/common/SR.cs
 ../../../external/referencesource/System.Xml/System/Xml/Assembly/System.Xml.Assembly.cs
 Dummy.cs
 System.Xml.Res.cs
 System.Xml.Utils.Res.cs
+ReferenceSources/Wsdl.cs
+ReferenceSources/TypeScope.cs
+ReferenceSources/SpecifiedAccessor.cs
 ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Assembly.cs
 ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/GenerateHelper.cs
 ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/IteratorDescriptor.cs

+ 3 - 0
mcs/class/System.XML/mobile_System.Xml.dll.sources

@@ -2,9 +2,12 @@ Assembly/AssemblyInfo.cs
 ../../build/common/Consts.cs
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
+../../build/common/SR.cs
 Dummy.cs
 System.Xml.Res.cs
 System.Xml.Utils.Res.cs
+ReferenceSources/TypeScope.cs
+ReferenceSources/Wsdl.cs
 ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Assembly.cs
 ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/ISourceLineInfo.cs
 ../../../external/referencesource/System.Data.SqlXml/System/Xml/Xsl/ListBase.cs