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

◆ TryGetTimeZoneFromLocalMachine() [1/2]

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

Definition at line 2180 of file TimeZoneInfo.cs.

2181 {
2185 {
2186 if (cachedData._systemTimeZones == null)
2187 {
2188 cachedData._systemTimeZones = new Dictionary<string, TimeZoneInfo>(StringComparer.OrdinalIgnoreCase) { { "UTC", s_utcTimeZone } };
2189 }
2190 if (!id.Equals("UTC", StringComparison.OrdinalIgnoreCase))
2191 {
2192 cachedData._systemTimeZones.Add(id, value2);
2193 }
2194 if (dstDisabled && value2._supportsDaylightSavingTime)
2195 {
2196 value = CreateCustomTimeZone(value2._id, value2._baseUtcOffset, value2._displayName, value2._standardDisplayName);
2197 }
2198 else
2199 {
2200 value = new TimeZoneInfo(value2._id, value2._baseUtcOffset, value2._displayName, value2._standardDisplayName, value2._daylightDisplayName, value2._adjustmentRules, disableDaylightSavingTime: false, value2.HasIanaId);
2201 }
2202 }
2203 else
2204 {
2205 value = null;
2206 }
2207 return timeZoneInfoResult;
2208 }
void Add(TKey key, TValue value)
static TimeZoneInfoResult TryGetTimeZoneFromLocalMachine(string id, bool dstDisabled, out TimeZoneInfo value, out Exception e, CachedData cachedData)
static readonly TimeZoneInfo s_utcTimeZone
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)
bool Equals([NotNullWhen(true)] TimeZoneInfo? other)

References System.TimeZoneInfo.TimeZoneInfo(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.TimeZoneInfo.CreateCustomTimeZone(), System.Runtime.Serialization.Dictionary, System.TimeZoneInfo.Equals(), System.StringComparer.OrdinalIgnoreCase, System.TimeZoneInfo.s_utcTimeZone, System.TimeZoneInfo.TryGetTimeZoneFromLocalMachine(), and System.value.

Referenced by System.TimeZoneInfo.TryGetTimeZoneFromLocalMachine(), and System.TimeZoneInfo.TryGetTimeZoneUsingId().