Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryGetTimeZoneUsingId()

static TimeZoneInfoResult System.TimeZoneInfo.TryGetTimeZoneUsingId ( string id,
bool dstDisabled,
out TimeZoneInfo value,
out Exception e,
CachedData cachedData,
bool alwaysFallbackToLocalMachine )
inlinestaticprivate

Definition at line 2152 of file TimeZoneInfo.cs.

2153 {
2154 TimeZoneInfoResult result = TimeZoneInfoResult.Success;
2155 e = null;
2156 if (cachedData._systemTimeZones != null && cachedData._systemTimeZones.TryGetValue(id, out var value2))
2157 {
2158 if (dstDisabled && value2._supportsDaylightSavingTime)
2159 {
2160 value = CreateCustomTimeZone(value2._id, value2._baseUtcOffset, value2._displayName, value2._standardDisplayName);
2161 }
2162 else
2163 {
2164 value = new TimeZoneInfo(value2._id, value2._baseUtcOffset, value2._displayName, value2._standardDisplayName, value2._daylightDisplayName, value2._adjustmentRules, disableDaylightSavingTime: false, value2.HasIanaId);
2165 }
2166 return result;
2167 }
2168 if (!cachedData._allSystemTimeZonesRead || alwaysFallbackToLocalMachine)
2169 {
2171 }
2172 else
2173 {
2174 result = TimeZoneInfoResult.TimeZoneNotFoundException;
2175 value = null;
2176 }
2177 return result;
2178 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static TimeZoneInfoResult TryGetTimeZoneFromLocalMachine(string id, bool dstDisabled, out TimeZoneInfo value, out Exception e, CachedData cachedData)
static TimeZoneInfo CreateCustomTimeZone(string id, TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName)
TimeZoneInfo(string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, AdjustmentRule[] adjustmentRules, bool disableDaylightSavingTime, bool hasIanaId=false)

References System.TimeZoneInfo.TimeZoneInfo(), System.TimeZoneInfo.CreateCustomTimeZone(), System.TimeZoneInfo.TryGetTimeZoneFromLocalMachine(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.TimeZoneInfo.TryGetTimeZone().