static readonly Func<SynchronizationContext> getDefaultSyncContext;
static readonly Func<string> getDefaultTimeZone;
+ static readonly Func<TimeZone> getCurrentSystemTimeZone;
static AndroidPlatform ()
{
Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true)
.GetMethod ("GetDefaultTimeZone",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic));
+
+ getCurrentSystemTimeZone = (Func<TimeZone>)
+ Delegate.CreateDelegate (typeof(Func<TimeZone>),
+ Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true)
+ .GetMethod ("GetCurrentSystemTimeZone",
+ System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic));
}
internal static SynchronizationContext GetDefaultSyncContext ()
{
return getDefaultTimeZone ();
}
+
+ internal static TimeZone GetCurrentSystemTimeZone ()
+ {
+ if (getCurrentSystemTimeZone == null)
+ return null;
+ return getCurrentSystemTimeZone ();
+ }
}
}
#endif