-Added ITraceWriter
-Fixed .NET 2.0 build using DateTimeOffset
This commit is contained in:
@@ -332,7 +332,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
if (targetType == typeof (Uri))
|
||||
return new Uri((string) initialValue, UriKind.RelativeOrAbsolute);
|
||||
if (targetType == typeof (TimeSpan))
|
||||
#if !(NET35 || NET20 || SILVERLIGHT || PORTABLE)
|
||||
#if !(NET35 || NET20 || PORTABLE)
|
||||
return TimeSpan.Parse((string) initialValue, CultureInfo.InvariantCulture);
|
||||
#else
|
||||
return TimeSpan.Parse((string)initialValue);
|
||||
@@ -395,7 +395,16 @@ namespace Newtonsoft.Json.Utilities
|
||||
/// </returns>
|
||||
public static bool TryConvert(object initialValue, CultureInfo culture, Type targetType, out object convertedValue)
|
||||
{
|
||||
return MiscellaneousUtils.TryAction<object>(delegate { return Convert(initialValue, culture, targetType); }, out convertedValue);
|
||||
try
|
||||
{
|
||||
convertedValue = Convert(initialValue, culture, targetType);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
convertedValue = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user