|
@@ -247,6 +247,29 @@ public sealed class Settings : INotifyPropertyChanged, IDisposable
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Proxy for binding to the a timezone.
|
|
|
+ /// </summary>
|
|
|
+ [JsonIgnore]
|
|
|
+ public TimeZoneInfo TimeZoneInfo
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ return TimeZoneInfo.FindSystemTimeZoneById(TimeZone);
|
|
|
+ }
|
|
|
+ catch (TimeZoneNotFoundException)
|
|
|
+ {
|
|
|
+ return TimeZoneInfo.Local;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ TimeZone = value.Id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#endregion "Properties"
|
|
|
|
|
|
/// <summary>
|
|
@@ -349,22 +372,6 @@ public sealed class Settings : INotifyPropertyChanged, IDisposable
|
|
|
Height = (int)exp;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Gets the time zone selected in settings, or local by default.
|
|
|
- /// </summary>
|
|
|
- public TimeZoneInfo GetTimeZoneInfo()
|
|
|
- {
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- return TimeZoneInfo.FindSystemTimeZoneById(TimeZone);
|
|
|
- }
|
|
|
- catch (TimeZoneNotFoundException)
|
|
|
- {
|
|
|
- return TimeZoneInfo.Local;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public void Dispose()
|
|
|
{
|
|
|
// We don't dispose of the watcher anymore because it would actually hang indefinitely if you had multiple instances of the same clock open.
|