-Upgraded Silverlight project to Silverlight 4

-Included .NET 4 features in Silverlight project
This commit is contained in:
JamesNK
2011-01-03 05:19:57 +00:00
parent 1aa3ff31a1
commit a96f4d4248
18 changed files with 134 additions and 51 deletions
+3 -12
View File
@@ -30,7 +30,7 @@ using System.Text;
using Newtonsoft.Json.Utilities;
using System.Globalization;
using System.ComponentModel;
#if !(NET35 || NET20 || SILVERLIGHT)
#if !(NET35 || NET20 || WINDOWS_PHONE)
using System.Dynamic;
using System.Linq.Expressions;
#endif
@@ -406,7 +406,7 @@ namespace Newtonsoft.Json.Linq
return _value.GetHashCode();
}
#if !(NET35 || NET20 || SILVERLIGHT)
#if !(NET35 || NET20 || WINDOWS_PHONE)
/// <summary>
/// Returns the <see cref="T:System.Dynamic.DynamicMetaObject"/> responsible for binding operations performed on this object.
/// </summary>
@@ -437,16 +437,7 @@ namespace Newtonsoft.Json.Linq
return ReflectionUtils.IsNullable(binder.Type);
}
Type t = binder.Type;
if (ReflectionUtils.IsNullableType(t))
t = Nullable.GetUnderlyingType(t);
TypeConverter converter = TypeDescriptor.GetConverter(instance.Value);
if (converter != null && converter.CanConvertTo(t))
result = converter.ConvertTo(instance.Value, t);
else
result = Convert.ChangeType(instance.Value, t, CultureInfo.InvariantCulture);
result = ConvertUtils.Convert(instance.Value, CultureInfo.InvariantCulture, binder.Type);
return true;
}
}