Imported Upstream version 4.6.0.165

Former-commit-id: d509131f71da404210981e7263b375675928eea7
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-25 10:13:16 +00:00
parent b95516a3dd
commit c911219690
458 changed files with 262 additions and 826 deletions

View File

@@ -247,7 +247,7 @@ namespace System.Diagnostics {
return i != 0;
}
public static void GetFullNameForStackTrace (StringBuilder sb, MethodBase mi)
internal void GetFullNameForStackTrace (StringBuilder sb, MethodBase mi)
{
var declaringType = mi.DeclaringType;
if (declaringType.IsGenericType && !declaringType.IsGenericTypeDefinition)

View File

@@ -127,22 +127,18 @@ namespace System.Globalization
get {
return Thread.CurrentThread.CurrentCulture;
}
#if NETSTANDARD
set {
throw new NotImplementedException ();
}
#endif
}
public static CultureInfo CurrentUICulture {
get {
return Thread.CurrentThread.CurrentUICulture;
}
#if NETSTANDARD
set {
throw new NotImplementedException ();
}
#endif
}
internal static CultureInfo ConstructCurrentCulture ()

View File

@@ -433,11 +433,9 @@ namespace System.Reflection {
get {
return (cultureinfo == null)? null : cultureinfo.Name;
}
#if NETSTANDARD
set {
throw new NotImplementedException ();
}
#endif
}
[ComVisibleAttribute(false)]

View File

@@ -412,7 +412,14 @@ namespace System
public static DateTime ConvertTimeBySystemTimeZoneId (DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId)
{
return ConvertTime (dateTime, FindSystemTimeZoneById (sourceTimeZoneId), FindSystemTimeZoneById (destinationTimeZoneId));
TimeZoneInfo source_tz;
if (dateTime.Kind == DateTimeKind.Utc && sourceTimeZoneId == TimeZoneInfo.Utc.Id) {
source_tz = Utc;
} else {
source_tz = FindSystemTimeZoneById (sourceTimeZoneId);
}
return ConvertTime (dateTime, source_tz, FindSystemTimeZoneById (destinationTimeZoneId));
}
public static DateTimeOffset ConvertTimeBySystemTimeZoneId (DateTimeOffset dateTimeOffset, string destinationTimeZoneId)

View File

@@ -659,6 +659,14 @@ namespace MonoTests.System
Assert.AreEqual (expectedDate, lastMidnightAsEST);
Assert.AreEqual (lastMidnight, lastMidnightAsPST);
}
[Test]
public void ConvertTimeBySystemTimeZoneId_UtcId ()
{
DateTime localTime = TimeZoneInfo.ConvertTime (DateTime.UtcNow, TimeZoneInfo.Utc, TimeZoneInfo.Local);
TimeZoneInfo.ConvertTimeBySystemTimeZoneId (DateTime.UtcNow, TimeZoneInfo.Utc.Id, TimeZoneInfo.Local.Id);
}
}
[TestFixture]