From 3f94471b5a9a5be0924b9de323250629bdf74f59 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Tue, 28 Dec 2010 22:02:08 +0900 Subject: [PATCH] Actually we have almost what we need on mobile profiles. --- mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs | 6 +++--- mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs | 2 +- mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs | 4 ++-- mcs/class/System.Xaml/System.Xaml/XamlType.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs b/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs index 05c0cf8c98e..46933967798 100755 --- a/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs +++ b/mcs/class/System.Xaml/System.Windows.Markup/ArrayExtension.cs @@ -39,7 +39,7 @@ namespace System.Windows.Markup { public ArrayExtension () { -#if NET_2_1 +#if MOONLIGHT items = new List (); #else items = new ArrayList (); @@ -51,7 +51,7 @@ namespace System.Windows.Markup if (elements == null) throw new ArgumentNullException ("elements"); Type = elements.GetType ().GetElementType (); -#if NET_2_1 +#if MOONLIGHT items = new List (); foreach (var element in elements) items.Add (element); @@ -65,7 +65,7 @@ namespace System.Windows.Markup if (arrayType == null) throw new ArgumentNullException ("arrayType"); Type = arrayType; -#if NET_2_1 +#if MOONLIGHT items = new List (); #else items = new ArrayList (); diff --git a/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs b/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs index 451211cea70..1a8d4af1e31 100644 --- a/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs +++ b/mcs/class/System.Xaml/System.Xaml/TypeExtensionMethods.cs @@ -118,7 +118,7 @@ namespace System.Xaml public static TypeConverter GetTypeConverter (this Type type) { -#if NET_2_1 +#if MOONLIGHT if (typeof (IConvertible).IsAssignableFrom (type)) return (TypeConverter) Activator.CreateInstance (typeof (ConvertibleTypeConverter<>).MakeGenericType (new Type [] {type})); var name = type.GetCustomAttribute (true).ConverterTypeName; diff --git a/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs b/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs index bd52ac64c84..62e809831b7 100644 --- a/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs +++ b/mcs/class/System.Xaml/System.Xaml/XamlSchemaContext.cs @@ -94,7 +94,7 @@ namespace System.Xaml } IEnumerable AssembliesInScope { -#if NET_2_1 +#if MOONLIGHT get { return reference_assemblies; } #else get { return reference_assemblies ?? AppDomain.CurrentDomain.GetAssemblies (); } @@ -234,7 +234,7 @@ namespace System.Xaml protected internal virtual Assembly OnAssemblyResolve (string assemblyName) { -#if NET_2_1 +#if MOONLIGHT return Assembly.Load (assemblyName); #else return Assembly.LoadWithPartialName (assemblyName); diff --git a/mcs/class/System.Xaml/System.Xaml/XamlType.cs b/mcs/class/System.Xaml/System.Xaml/XamlType.cs index a4c33a56089..ac31f2cddc9 100755 --- a/mcs/class/System.Xaml/System.Xaml/XamlType.cs +++ b/mcs/class/System.Xaml/System.Xaml/XamlType.cs @@ -770,8 +770,8 @@ namespace System.Xaml // It's still not decent to check CollectionConverter. var tct = t.GetTypeConverter ().GetType (); -#if NET_2_1 - if (tct != typeof (TypeConverter)) +#if MOONLIGHT + if (tct != typeof (TypeConverter) && tct.Name != "CollectionConverter" && tct.Name != "ReferenceConverter") #else if (tct != typeof (TypeConverter) && tct != typeof (CollectionConverter) && tct != typeof (ReferenceConverter)) #endif -- 2.11.4.GIT