diff options
Diffstat (limited to 'src/mscorlib/src/System/TimeZoneInfo.cs')
-rw-r--r-- | src/mscorlib/src/System/TimeZoneInfo.cs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mscorlib/src/System/TimeZoneInfo.cs b/src/mscorlib/src/System/TimeZoneInfo.cs index 1f628793d4..c37d81bd2b 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.cs @@ -164,7 +164,7 @@ namespace System { if (!SupportsDaylightSavingTime) { - throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetIsNotAmbiguous"), nameof(dateTimeOffset)); + throw new ArgumentException(SR.Argument_DateTimeOffsetIsNotAmbiguous, nameof(dateTimeOffset)); } Contract.EndContractBlock(); @@ -180,7 +180,7 @@ namespace System if (!isAmbiguous) { - throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetIsNotAmbiguous"), nameof(dateTimeOffset)); + throw new ArgumentException(SR.Argument_DateTimeOffsetIsNotAmbiguous, nameof(dateTimeOffset)); } // the passed in dateTime is ambiguous in this TimeZoneInfo instance @@ -210,7 +210,7 @@ namespace System { if (!SupportsDaylightSavingTime) { - throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsNotAmbiguous"), nameof(dateTime)); + throw new ArgumentException(SR.Argument_DateTimeIsNotAmbiguous, nameof(dateTime)); } Contract.EndContractBlock(); @@ -240,7 +240,7 @@ namespace System if (!isAmbiguous) { - throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsNotAmbiguous"), nameof(dateTime)); + throw new ArgumentException(SR.Argument_DateTimeIsNotAmbiguous, nameof(dateTime)); } // the passed in dateTime is ambiguous in this TimeZoneInfo instance @@ -649,7 +649,7 @@ namespace System DateTimeKind sourceKind = cachedData.GetCorrespondingKind(sourceTimeZone); if (((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && (dateTime.Kind != DateTimeKind.Unspecified) && (dateTime.Kind != sourceKind)) { - throw new ArgumentException(Environment.GetResourceString("Argument_ConvertMismatch"), nameof(sourceTimeZone)); + throw new ArgumentException(SR.Argument_ConvertMismatch, nameof(sourceTimeZone)); } // @@ -675,7 +675,7 @@ namespace System // period that supports DST if (((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && GetIsInvalidTime(dateTime, sourceRule, sourceDaylightTime)) { - throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsInvalid"), nameof(dateTime)); + throw new ArgumentException(SR.Argument_DateTimeIsInvalid, nameof(dateTime)); } sourceIsDaylightSavings = GetIsDaylightSavings(dateTime, sourceRule, sourceDaylightTime, flags); @@ -767,7 +767,7 @@ namespace System } if (source.Length == 0) { - throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSerializedString", source), nameof(source)); + throw new ArgumentException(SR.Format(SR.Argument_InvalidSerializedString, source), nameof(source)); } Contract.EndContractBlock(); @@ -1001,16 +1001,16 @@ namespace System if (adjustmentRulesSupportDst != _supportsDaylightSavingTime) { - throw new SerializationException(Environment.GetResourceString("Serialization_CorruptField", "SupportsDaylightSavingTime")); + throw new SerializationException(SR.Format(SR.Serialization_CorruptField, "SupportsDaylightSavingTime")); } } catch (ArgumentException e) { - throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); + throw new SerializationException(SR.Serialization_InvalidData, e); } catch (InvalidTimeZoneException e) { - throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); + throw new SerializationException(SR.Serialization_InvalidData, e); } } @@ -1880,17 +1880,17 @@ namespace System if (id.Length == 0) { - throw new ArgumentException(Environment.GetResourceString("Argument_InvalidId", id), nameof(id)); + throw new ArgumentException(SR.Format(SR.Argument_InvalidId, id), nameof(id)); } if (UtcOffsetOutOfRange(baseUtcOffset)) { - throw new ArgumentOutOfRangeException(nameof(baseUtcOffset), Environment.GetResourceString("ArgumentOutOfRange_UtcOffset")); + throw new ArgumentOutOfRangeException(nameof(baseUtcOffset), SR.ArgumentOutOfRange_UtcOffset); } if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0) { - throw new ArgumentException(Environment.GetResourceString("Argument_TimeSpanHasSeconds"), nameof(baseUtcOffset)); + throw new ArgumentException(SR.Argument_TimeSpanHasSeconds, nameof(baseUtcOffset)); } Contract.EndContractBlock(); @@ -1914,7 +1914,7 @@ namespace System if (current == null) { - throw new InvalidTimeZoneException(Environment.GetResourceString("Argument_AdjustmentRulesNoNulls")); + throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesNoNulls); } // FUTURE: check to see if this rule supports Daylight Saving Time @@ -1923,13 +1923,13 @@ namespace System if (UtcOffsetOutOfRange(baseUtcOffset + current.DaylightDelta)) { - throw new InvalidTimeZoneException(Environment.GetResourceString("ArgumentOutOfRange_UtcOffsetAndDaylightDelta")); + throw new InvalidTimeZoneException(SR.ArgumentOutOfRange_UtcOffsetAndDaylightDelta); } if (prev != null && current.DateStart <= prev.DateEnd) { // verify the rules are in chronological order and the DateStart/DateEnd do not overlap - throw new InvalidTimeZoneException(Environment.GetResourceString("Argument_AdjustmentRulesOutOfOrder")); + throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesOutOfOrder); } } } |