Browse Source

Kill the MOONLIGHT define in System.Runtime.Serialization.

Rodrigo Kumpera 13 years ago
parent
commit
9b9effd98a

+ 0 - 4
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/KnownTypeCollection.cs

@@ -686,7 +686,6 @@ namespace System.Runtime.Serialization
 
 		static QName GetSerializableQName (Type type)
 		{
-#if !MOONLIGHT
 			// First, check XmlSchemaProviderAttribute and try GetSchema() to see if it returns a schema in the expected format.
 			var xpa = type.GetCustomAttribute<XmlSchemaProviderAttribute> (true);
 			if (xpa != null) {
@@ -700,7 +699,6 @@ namespace System.Runtime.Serialization
 					}
 				}
 			}
-#endif
 
 			string xmlName = type.Name;
 			if (type.IsGenericType) {
@@ -725,11 +723,9 @@ namespace System.Runtime.Serialization
 				return true;
 			if (type == typeof (Guid) || type == typeof (object) || type == typeof(TimeSpan) || type == typeof(byte[]) || type == typeof(Uri) || type == typeof(DateTimeOffset)) // special primitives
 				return true;
-#if !MOONLIGHT
 			// DOM nodes
 			if (type == typeof (XmlElement) || type == typeof (XmlNode []))
 				return true;
-#endif
 			// nullable
 			if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>))
 				return IsPrimitiveNotEnum (type.GetGenericArguments () [0]);

+ 0 - 12
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterDeserializer.cs

@@ -104,19 +104,16 @@ namespace System.Runtime.Serialization
 			get { return references; }
 		}
 
-#if !MOONLIGHT
 		XmlDocument document;
 		
 		XmlDocument XmlDocument {
 			get { return (document = document ?? new XmlDocument ()); }
 		}
-#endif
 
 		// This method handles z:Ref, xsi:nil and primitive types, and then delegates to DeserializeByMap() for anything else.
 
 		public object Deserialize (Type type, XmlReader reader)
 		{
-#if !MOONLIGHT
 			if (type == typeof (XmlElement))
 				return XmlDocument.ReadNode (reader);
 			else if (type == typeof (XmlNode [])) {
@@ -127,7 +124,6 @@ namespace System.Runtime.Serialization
 				reader.ReadEndElement ();
 				return l.ToArray ();
 			}
-#endif
 			QName graph_qname = null;
 			
 			if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>)) {
@@ -275,15 +271,7 @@ namespace System.Runtime.Serialization
 			foreach (var ass in AppDomain.CurrentDomain.GetAssemblies ()) {
 				Type [] types;
 
-#if MOONLIGHT
-				try  {
-					types = ass.GetTypes ();
-				} catch (System.Reflection.ReflectionTypeLoadException rtle) {
-					types = rtle.Types;
-				}
-#else
 				types = ass.GetTypes ();
-#endif
 				if (types == null)
 					continue;
 

+ 0 - 2
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/XmlFormatterSerializer.cs

@@ -87,14 +87,12 @@ namespace System.Runtime.Serialization
 		{
 			if (graph == null)
 				writer.WriteAttributeString ("i", "nil", XmlSchema.InstanceNamespace, "true");
-#if !MOONLIGHT
 			else if (type == typeof (XmlElement))
 				((XmlElement) graph).WriteTo (Writer);
 			else if (type == typeof (XmlNode [])) {
 				foreach (var xn in (XmlNode []) graph)
 					xn.WriteTo (Writer);
 			}
-#endif
 			else {
 				QName resolvedQName = null;
 				if (resolver != null) {