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

◆ ValidateTimeZoneInfo()

static void System.TimeZoneInfo.ValidateTimeZoneInfo ( string id,
TimeSpan baseUtcOffset,
AdjustmentRule[] adjustmentRules,
out bool adjustmentRulesSupportDst )
inlinestaticprivate

Definition at line 2210 of file TimeZoneInfo.cs.

2211 {
2212 if (id == null)
2213 {
2214 throw new ArgumentNullException("id");
2215 }
2216 if (id.Length == 0)
2217 {
2218 throw new ArgumentException(SR.Format(SR.Argument_InvalidId, id), "id");
2219 }
2221 {
2222 throw new ArgumentOutOfRangeException("baseUtcOffset", SR.ArgumentOutOfRange_UtcOffset);
2223 }
2224 if (baseUtcOffset.Ticks % 600000000 != 0L)
2225 {
2226 throw new ArgumentException(SR.Argument_TimeSpanHasSeconds, "baseUtcOffset");
2227 }
2229 if (adjustmentRules == null || adjustmentRules.Length == 0)
2230 {
2231 return;
2232 }
2234 AdjustmentRule adjustmentRule = null;
2235 AdjustmentRule adjustmentRule2 = null;
2236 for (int i = 0; i < adjustmentRules.Length; i++)
2237 {
2240 if (adjustmentRule2 == null)
2241 {
2242 throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesNoNulls);
2243 }
2245 {
2246 throw new InvalidTimeZoneException(SR.ArgumentOutOfRange_UtcOffsetAndDaylightDelta);
2247 }
2248 if (adjustmentRule != null && adjustmentRule2.DateStart <= adjustmentRule.DateEnd)
2249 {
2250 throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesOutOfOrder);
2251 }
2252 }
2253 }
static bool UtcOffsetOutOfRange(TimeSpan offset)
static bool IsValidAdjustmentRuleOffset(TimeSpan baseUtcOffset, AdjustmentRule adjustmentRule)

References System.SR.Argument_AdjustmentRulesNoNulls, System.SR.Argument_AdjustmentRulesOutOfOrder, System.SR.Argument_InvalidId, System.SR.Argument_TimeSpanHasSeconds, System.SR.ArgumentOutOfRange_UtcOffset, System.SR.ArgumentOutOfRange_UtcOffsetAndDaylightDelta, System.Runtime.Serialization.Dictionary, System.SR.Format(), System.TimeZoneInfo.InvalidTimeZoneException, System.TimeZoneInfo.IsValidAdjustmentRuleOffset(), System.L, and System.TimeZoneInfo.UtcOffsetOutOfRange().

Referenced by System.TimeZoneInfo.TimeZoneInfo(), System.TimeZoneInfo.TimeZoneInfo(), and System.TimeZoneInfo.OnDeserialization().