From 054957354ba123693e94ff1de2c83675b5e64f46 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Mon, 11 Feb 2013 13:37:15 -0500 Subject: [PATCH] Kill MOONLIGHT from System.Xaml. --- .../System.Windows.Markup/ArrayExtension.cs | 14 -------------- .../System.Xaml/TypeExtensionMethods.cs | 7 ------- .../System.Xaml/System.Xaml/XamlSchemaContext.cs | 8 -------- mcs/class/System.Xaml/System.Xaml/XamlType.cs | 4 ---- 4 files changed, 33 deletions(-) diff --git a/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs b/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs index 46933967798..7a99b796010 100755 --- a/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs +++ b/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs @@ -39,11 +39,7 @@ namespace System.Windows.Markup { public ArrayExtension () { -#if MOONLIGHT - items = new List (); -#else items = new ArrayList (); -#endif } public ArrayExtension (Array elements) @@ -51,13 +47,7 @@ namespace System.Windows.Markup if (elements == null) throw new ArgumentNullException ("elements"); Type = elements.GetType ().GetElementType (); -#if MOONLIGHT - items = new List (); - foreach (var element in elements) - items.Add (element); -#else items = new ArrayList (elements); -#endif } public ArrayExtension (Type arrayType) @@ -65,11 +55,7 @@ namespace System.Windows.Markup if (arrayType == null) throw new ArgumentNullException ("arrayType"); Type = arrayType; -#if MOONLIGHT - items = new List (); -#else items = new ArrayList (); -#endif } [ConstructorArgument ("arrayType")] diff --git a/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs b/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs index 12597fb11f1..c7002e5c8ee 100644 --- a/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs +++ b/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs @@ -121,14 +121,7 @@ namespace System.Xaml public static TypeConverter GetTypeConverter (this Type type) { -#if MOONLIGHT - if (typeof (IConvertible).IsAssignableFrom (type)) - return (TypeConverter) Activator.CreateInstance (typeof (ConvertibleTypeConverter<>).MakeGenericType (new Type [] {type})); - var name = type.GetCustomAttribute (true).ConverterTypeName; - return (TypeConverter) Activator.CreateInstance (type.Assembly.GetType (name) ?? Type.GetType (name)); -#else return TypeDescriptor.GetConverter (type); -#endif } // FIXME: I want this to cover all the existing types and make it valid in both NET_2_1 and !NET_2_1. diff --git a/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs b/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs index 74d7bab69d0..de31e46de24 100644 --- a/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs +++ b/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs @@ -94,11 +94,7 @@ namespace System.Xaml } IEnumerable AssembliesInScope { -#if MOONLIGHT - get { return reference_assemblies; } -#else get { return reference_assemblies ?? AppDomain.CurrentDomain.GetAssemblies (); } -#endif } public bool SupportMarkupExtensionsWithDuplicateArity { get; private set; } @@ -244,11 +240,7 @@ namespace System.Xaml protected internal virtual Assembly OnAssemblyResolve (string assemblyName) { -#if MOONLIGHT - return Assembly.Load (assemblyName); -#else return Assembly.LoadWithPartialName (assemblyName); -#endif } public virtual bool TryGetCompatibleXamlNamespace (string xamlNamespace, out string compatibleNamespace) diff --git a/mcs/class/System.Xaml/System.Xaml/XamlType.cs b/mcs/class/System.Xaml/System.Xaml/XamlType.cs index 5daf424f194..6aebc3ebddd 100755 --- a/mcs/class/System.Xaml/System.Xaml/XamlType.cs +++ b/mcs/class/System.Xaml/System.Xaml/XamlType.cs @@ -771,11 +771,7 @@ namespace System.Xaml // It's still not decent to check CollectionConverter. var tct = t.GetTypeConverter ().GetType (); -#if MOONLIGHT - if (tct != typeof (TypeConverter) && tct.Name != "CollectionConverter" && tct.Name != "ReferenceConverter") -#else if (tct != typeof (TypeConverter) && tct != typeof (CollectionConverter) && tct != typeof (ReferenceConverter)) -#endif return SchemaContext.GetValueConverter (tct, this); return null; } -- 2.25.1