Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2019-03-06 06:37:33 +0300
committerMarek Safar <marek.safar@gmail.com>2019-03-07 02:42:25 +0300
commit6d8df4e7f3adaf3824c66a552bd1b930047391e3 (patch)
tree45acb3cc146b8d03fb838445afaae6492eb8f174 /netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs
parentd56e47721aa989f4b553ec0a4248921a7f8d3637 (diff)
Clean up some string.Format usage (dotnet/coreclr#23025)
* Clean up some string.Format usage Mainly changes some string.Format usage to be SR.Format when working with resource strings. Also cleans up a few asserts that were using string.Format. * Address PR feedback and clean up src * Address more feedback * Update src/System.Private.CoreLib/shared/System/Type.Enum.cs Thanks. Co-Authored-By: stephentoub <stoub@microsoft.com> Signed-off-by: dotnet-bot <anirudhagnihotry098@gmail.com>
Diffstat (limited to 'netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs')
-rw-r--r--netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs21
1 files changed, 7 insertions, 14 deletions
diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs
index ebe6892ee63..b7dd8682581 100644
--- a/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs
+++ b/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs
@@ -182,8 +182,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
nameof(year),
- string.Format(
- CultureInfo.CurrentCulture,
+ SR.Format(
SR.ArgumentOutOfRange_Range,
m_EraInfo[i].minEraYear,
m_EraInfo[i].maxEraYear));
@@ -324,8 +323,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
nameof(millisecond),
- string.Format(
- CultureInfo.CurrentCulture,
+ SR.Format(
SR.ArgumentOutOfRange_Range,
0,
MillisPerSecond - 1));
@@ -342,7 +340,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
"time",
- string.Format(
+ SR.Format(
CultureInfo.InvariantCulture,
SR.ArgumentOutOfRange_CalendarRange,
m_Cal.MinSupportedDateTime,
@@ -373,8 +371,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
nameof(months),
- string.Format(
- CultureInfo.CurrentCulture,
+ SR.Format(
SR.ArgumentOutOfRange_Range,
-120000,
120000));
@@ -571,8 +568,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
nameof(day),
- string.Format(
- CultureInfo.CurrentCulture,
+ SR.Format(
SR.ArgumentOutOfRange_Range,
1,
GetDaysInMonth(year, month, era)));
@@ -610,8 +606,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
nameof(month),
- string.Format(
- CultureInfo.CurrentCulture,
+ SR.Format(
SR.ArgumentOutOfRange_Range,
1,
12));
@@ -665,9 +660,7 @@ namespace System.Globalization
{
throw new ArgumentOutOfRangeException(
nameof(year),
- string.Format(
- CultureInfo.CurrentCulture,
- SR.ArgumentOutOfRange_Range, m_minYear, m_maxYear));
+ SR.Format(SR.ArgumentOutOfRange_Range, m_minYear, m_maxYear));
}
// If the year value is above 100, just return the year value. Don't have to do
// the TwoDigitYearMax comparison.