2 types derived from CultureInfo
System.Windows.Forms.Tests (1)
System.Xaml.Tests (1)
514 instantiations of CultureInfo
aspire (1)
Aspire.Dashboard.Components.Tests (2)
Aspire.Dashboard.Tests (6)
Aspire.Hosting.Tests (4)
Aspire.TestUtilities (2)
BasicTestApp (2)
BasicWebSite (2)
dotnet-svcutil.xmlserializer (1)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (1)
HtmlGenerationWebSite (5)
Infrastructure.Common (1)
InteractiveHost.UnitTests (1)
InteractiveHost32 (2)
InteractiveHost64 (2)
LocalizationSample (16)
LocalizationWebsite (12)
Microsoft.AspNetCore.Components.Tests (3)
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Microsoft.AspNetCore.Html.Abstractions.Tests (2)
Microsoft.AspNetCore.InternalTesting (7)
Microsoft.AspNetCore.InternalTesting.Tests (6)
Microsoft.AspNetCore.Localization (5)
Microsoft.AspNetCore.Localization.Routing.Tests (4)
Microsoft.AspNetCore.Localization.Tests (37)
Microsoft.AspNetCore.Mvc.Core.Test (33)
Microsoft.AspNetCore.Mvc.FunctionalTests (6)
Microsoft.AspNetCore.Mvc.Localization.Test (2)
Microsoft.AspNetCore.Mvc.Razor (1)
Microsoft.Build.Framework (2)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (12)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (10)
4431Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4451Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4471Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4493Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4517Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4541Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4563Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4586Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4609Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
4633Using New CultureContext(New CultureInfo("tr-TR", useUserOverride:=False))
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
Microsoft.CodeAnalysis.Features (2)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (4)
Diagnostics\SarifErrorLoggerTests.cs (2)
33using (var logger = CreateLogger(stream, "toolName", "1.2.3.4 for Windows", new Version(1, 2, 3, 4), new CultureInfo("fr-CA", useUserOverride: false)))
76using (var logger = CreateLogger(stream, "toolName", "1.2.3.4 for Windows", new Version(1, 2, 3, 4), new CultureInfo("en-US", useUserOverride: false)))
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.Data.Analysis.Tests (7)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.ML.AutoML.Tests (2)
Microsoft.ML.CodeGenerator.Tests (1)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.SearchSpace.Tests (1)
Microsoft.ML.TestFramework (1)
Microsoft.ML.Tests (2)
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
PresentationBuildTasks (1)
PresentationCore (13)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (4)
982new MajorLanguageDesc(new CultureInfo("en"), ScriptTags.Latin, LanguageTags.English), // English neutral culture
983new MajorLanguageDesc(new CultureInfo("de"), ScriptTags.Latin, LanguageTags.German), // German neutral culture
984new MajorLanguageDesc(new CultureInfo("ja"), ScriptTags.CJKIdeographic, LanguageTags.Japanese), // Japanese neutral culture
985new MajorLanguageDesc(new CultureInfo("ja"), ScriptTags.Hiragana, LanguageTags.Japanese) // Japanese neutral culture
PresentationCore.Tests (50)
System\Windows\DurationConverter.Tests.cs (5)
61yield return new object?[] { "17.22:10:15.4571230", new CultureInfo("ru-RU"), new Duration(new TimeSpan(17, 22, 10, 15, 457, 123)), true };
107yield return new object?[] { new Duration(TimeSpan.FromTicks(5624853448000)), new CultureInfo("ru-RU"), " 6:12:14:45,3448 " };
131yield return new object?[] { new CultureInfo("ru-RU"), " á " };
135yield return new object?[] { new CultureInfo("ru-RU"), " 6:12:14:45.3448 " };
157yield return new object?[] { new CultureInfo("ru-RU"), 12345 };
System\Windows\Input\Command\KeyGestureConverter.Tests.cs (7)
100yield return new object?[] { new KeyGesture(Key.Insert, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt), null, new CultureInfo("de-DE"), "Ctrl+Alt+Windows+Insert", };
104yield return new object?[] { new KeyGesture(Key.F21, ModifierKeys.Alt | ModifierKeys.Windows, "displayString"), null, new CultureInfo("ru-RU"), "Alt+Windows+F21,displayString" };
114yield return new object?[] { new KeyGesture(Key.Insert, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt), null, new CultureInfo("de-DE"), "Ctrl+Alt+Windows+Insert ", };
166yield return new object?[] { string.Empty, null, new CultureInfo("de-DE"), new KeyGesture(Key.None, ModifierKeys.Windows, validateGesture: false) };
167yield return new object?[] { string.Empty, null, new CultureInfo("ru-RU"), new KeyGesture(Key.None, ModifierKeys.Alt, validateGesture: false) };
175yield return new object?[] { "Ctrl+Alt+Windows+Insert", null, new CultureInfo("de-DE"), new KeyGesture(Key.Insert, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt) };
179yield return new object?[] { "Alt+Windows+F21,displayString", null, new CultureInfo("ru-RU"), new KeyGesture(Key.F21, ModifierKeys.Alt | ModifierKeys.Windows, "displayString") };
System\Windows\Input\Command\MouseGestureConverter.Tests.cs (7)
94yield return new object?[] { new MouseGesture(MouseAction.LeftClick, ModifierKeys.None), null, new CultureInfo("ru-RU"), "LeftClick" };
97yield return new object?[] { new MouseGesture(MouseAction.MiddleDoubleClick, ModifierKeys.Alt), null, new CultureInfo("no-NO"), "Alt+MiddleDoubleClick" };
108yield return new object?[] { new MouseGesture(MouseAction.MiddleClick, ModifierKeys.Windows | ModifierKeys.Shift), null, new CultureInfo("no-NO"), " Shift + Windows + MiddleClick " };
158yield return new object?[] { "Windows+", null, new CultureInfo("de-DE"), new MouseGesture(MouseAction.None, ModifierKeys.Windows) };
159yield return new object?[] { "Shift+", null, new CultureInfo("ru-RU"), new MouseGesture(MouseAction.None, ModifierKeys.Shift) };
165yield return new object?[] { "Ctrl+Alt+Windows+WheelClick", null, new CultureInfo("de-DE"), new MouseGesture(MouseAction.WheelClick, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt) };
166yield return new object?[] { "Alt+Windows+MiddleDoubleClick", null, new CultureInfo("ru-RU"), new MouseGesture(MouseAction.MiddleDoubleClick, ModifierKeys.Alt | ModifierKeys.Windows) };
System\Windows\Input\MouseActionConverter.Tests.cs (6)
88yield return new object?[] { MouseAction.LeftClick, null, new CultureInfo("ru-RU"), "LeftClick" };
91yield return new object?[] { MouseAction.WheelClick, null, new CultureInfo("no-NO"), "WheelClick" };
98yield return new object?[] { MouseAction.None, null, new CultureInfo("ru-RU"), " NoNE " };
101yield return new object?[] { MouseAction.MiddleClick, null, new CultureInfo("no-NO"), " MiDDLeCliCK " };
139yield return new object?[] { "RightClick", null, new CultureInfo("ru-RU"), MouseAction.RightClick };
141yield return new object?[] { "WheelClick", null, new CultureInfo("no-NO"), MouseAction.WheelClick };
System\Windows\Media\Animation\KeySplineConverter.Tests.cs (16)
64yield return new object[] { "0,25 ;0,1;0,25;1", 0.25, 0.1, 0.25, 1.0, new CultureInfo("fr-FR") };
65yield return new object[] { " 0,25;0,1 ;0,25;1", 0.25, 0.1, 0.25, 1.0, new CultureInfo("de-DE") };
66yield return new object[] { "0.25,0.1,0.25,1", 0.25, 0.1, 0.25, 1.0, new CultureInfo("en-US") };
67yield return new object[] { "0,25; 0,1;0,25;1 ", 0.25, 0.1, 0.25, 1.0, new CultureInfo("es-ES") };
69yield return new object[] { "0,5;0,75;0,25; 0,9", 0.5, 0.75, 0.25, 0.9, new CultureInfo("fr-FR") };
91yield return new object[] { "8,3; 0,4; 0,6; 1,8", new CultureInfo("fr-FR") };
104yield return new object[] { " 0.3, 1.8, 1.6, 0.7", new CultureInfo("de-DE") };
174new CultureInfo("en-US"), "1,0,0,1"
179new CultureInfo("fr-FR"), "1;0;0;1"
184new CultureInfo("de-DE"), "0,3;0,2;0,4;0,8"
209new CultureInfo("en-US"), "0.6,0.4,0.2,0.8"
219new CultureInfo("fr-FR"), "0,2;0,8;0,4;0,6"
224new CultureInfo("de-DE"), "0,75;0,25;0,5;0,5"
239new CultureInfo("en-US"), "0.4,0.4,0.6,0.6"
244new CultureInfo("fr-FR"), "0,8;0,2;0,3;0,7"
249new CultureInfo("de-DE"), "0,55;0,45;0,35;0,65"
System\Windows\TextDecorationCollectionConverter.Tests.cs (9)
68yield return new object[] { new TextDecorationCollection(), new CultureInfo("ru-RU"), string.Empty };
69yield return new object[] { new TextDecorationCollection(), new CultureInfo("no-NO"), " " };
70yield return new object[] { new TextDecorationCollection(), new CultureInfo("no-NO"), "None" };
71yield return new object[] { new TextDecorationCollection(), new CultureInfo("ru-RU"), " None " };
74yield return new object[] { new TextDecorationCollection([TextDecorations.Strikethrough[0]]), new CultureInfo("no-NO"), "Strikethrough" };
75yield return new object[] { new TextDecorationCollection([TextDecorations.Strikethrough[0]]), new CultureInfo("ru-RU"), "Strikethrough " };
78new CultureInfo("no-NO"),
81new CultureInfo("ru-RU"),
86new CultureInfo("fr-FR"), " Strikethrough ,Underline, Baseline , Overline " };
PresentationFramework (15)
PresentationFramework.Tests (52)
System\Windows\Controls\VirtualizationCacheLengthConverter.Tests.cs (52)
82yield return new object[] { "25;50", 25.0, 50.0, new CultureInfo("fr-FR") };
83yield return new object[] { "12,34;56,78", 12.34, 56.78, new CultureInfo("fr-FR") };
84yield return new object[] { "0;0", 0.0, 0.0, new CultureInfo("fr-FR") };
85yield return new object[] { "1;2", 1.0, 2.0, new CultureInfo("fr-FR") };
86yield return new object[] { "3,14;2,718", 3.14, 2.718, new CultureInfo("fr-FR") };
87yield return new object[] { "42;84", 42.0, 84.0, new CultureInfo("fr-FR") };
88yield return new object[] { "99,9;100,1", 99.9, 100.1, new CultureInfo("fr-FR") };
89yield return new object[] { "0,1;0,2", 0.1, 0.2, new CultureInfo("fr-FR") };
90yield return new object[] { "123;456", 123.0, 456.0, new CultureInfo("fr-FR") };
92yield return new object[] { "7,5;15,5", 7.5, 15.5, new CultureInfo("de-DE") };
95yield return new object[] { " 1;2", 1.0, 2.0, new CultureInfo("fr-FR") };
96yield return new object[] { "3,14; 2,718", 3.14, 2.718, new CultureInfo("fr-FR") };
101yield return new object[] { "88,8", 88.8, 88.8, new CultureInfo("de-DE") };
102yield return new object[] { "66.66", 66.66, 66.66, new CultureInfo("en-US") };
104yield return new object[] { "39,95", 39.95, 39.95, new CultureInfo("es-ES") };
105yield return new object[] { "110,1", 110.1, 110.1, new CultureInfo("fr-FR") };
107yield return new object[] { " 3,14", 3.14, 3.14, new CultureInfo("fr-FR") };
108yield return new object[] { "42 ", 42.0, 42.0, new CultureInfo("fr-FR") };
133yield return new object[] { (float)12.75, 12.75, new CultureInfo("fr-FR") };
134yield return new object[] { (short)100, 100.0, new CultureInfo("de-DE") };
136yield return new object[] { 33, 33.0, new CultureInfo("en-US") }; // int
137yield return new object[] { (long)50, 50.0, new CultureInfo("es-ES") };
138yield return new object[] { (ulong)856699, 856699.0, new CultureInfo("fr-FR") };
139yield return new object[] { (uint)6666, 6666.0, new CultureInfo("de-DE") };
158yield return new object?[] { new CultureInfo("ru-RU"), null };
177yield return new object?[] { new CultureInfo("ru-RU"), typeof(Duration) };
178yield return new object?[] { new CultureInfo("ru-RU"), typeof(TimeSpan) };
199yield return new object?[] { new CultureInfo("ru-RU"), "10.5;10.5" };
200yield return new object?[] { new CultureInfo("ru-RU"), "10.5,10.5" };
204yield return new object?[] { new CultureInfo("ru-RU"), "10,5.10,5" };
205yield return new object?[] { new CultureInfo("ru-RU"), "0.1,0.2,0.3" };
211yield return new object?[] { new CultureInfo("ru-RU"), string.Empty };
243yield return new object[] { "42.7,42.7", new VirtualizationCacheLength(42.7), new CultureInfo("en-US") };
245yield return new object[] { "-15,2;-15,2", new VirtualizationCacheLength(-15.2), new CultureInfo("fr-FR") };
246yield return new object[] { "3,14159;3,14159", new VirtualizationCacheLength(3.14159), new CultureInfo("de-DE") };
247yield return new object[] { "10000,10000", new VirtualizationCacheLength(10000), new CultureInfo("ja-JP") };
248yield return new object[] { "0.0005,0.0005", new VirtualizationCacheLength(0.0005), new CultureInfo("en-GB") };
249yield return new object[] { "-99,99;-99,99", new VirtualizationCacheLength(-99.99), new CultureInfo("es-ES") };
250yield return new object[] { "500,5;500,5", new VirtualizationCacheLength(500.5), new CultureInfo("it-IT") };
251yield return new object[] { "7;7", new VirtualizationCacheLength(7), new CultureInfo("pt-BR") };
252yield return new object[] { "1.23456,1.23456", new VirtualizationCacheLength(1.23456), new CultureInfo("en-US") };
256yield return new object[] { "-8.9,10.1", new VirtualizationCacheLength(-8.9, 10.1), new CultureInfo("en-US") };
257yield return new object[] { "0;25,5", new VirtualizationCacheLength(0.0, 25.5), new CultureInfo("fr-FR") };
258yield return new object[] { "100,75;200,25", new VirtualizationCacheLength(100.75, 200.25), new CultureInfo("de-DE") };
259yield return new object[] { "-0.001,0.002", new VirtualizationCacheLength(-0.001, 0.002), new CultureInfo("ja-JP") };
260yield return new object[] { "987.654,321.098", new VirtualizationCacheLength(987.654, 321.098), new CultureInfo("en-GB") };
261yield return new object[] { "-50;50", new VirtualizationCacheLength(-50.0, 50.0), new CultureInfo("es-ES") };
262yield return new object[] { "0,123;456,789", new VirtualizationCacheLength(0.123, 456.789), new CultureInfo("it-IT") };
263yield return new object[] { "9999,9;10000,1", new VirtualizationCacheLength(9999.9, 10000.1), new CultureInfo("pt-BR") };
281yield return new object[] { new VirtualizationCacheLength(17.5), typeof(Guid), new CultureInfo("de-DE") };
289yield return new object[] { new VirtualizationCacheLength(0.4, 0.5), typeof(TimeSpan), new CultureInfo("it-IT") };
293yield return new object[] { new VirtualizationCacheLength(0.6, 0.8), typeof(VirtualizationCacheLengthUnit), new CultureInfo("pt-BR") };
PresentationUI (1)
RazorPagesWebSite (2)
RazorWebSite (8)
ReachFramework (1)
Roslyn.VisualStudio.Next.UnitTests (1)
System.ComponentModel.TypeConverter (1)
System.Data.Common (9)
System.Data.Odbc (2)
System.Private.CoreLib (18)
System.Private.Windows.Core.TestUtilities (3)
System.Private.Xml (15)
System.Windows.Controls.Ribbon (1)
System.Windows.Forms (1)
System.Windows.Forms.Analyzers.CSharp.Tests (2)
System.Windows.Forms.Analyzers.Tests (1)
System.Windows.Forms.Design.Tests (7)
System.Windows.Forms.IntegrationTests.Common (1)
System.Windows.Forms.Tests (50)
System.Xaml.Tests (5)
System\Xaml\Replacements\DateTimeOffsetConverter2Tests.cs (3)
34yield return new object?[] { dateTimeOffset.ToString("O", new CultureInfo("en-US")), new CultureInfo("en-US"), dateTimeOffset };
71yield return new object?[] { new DateTimeOffset(2018, 12, 9, 1, 2, 3, 4, TimeSpan.FromMinutes(10)), new CultureInfo("en-US") };
UIAutomationClient (1)
WindowsBase.Tests (18)
10015 references to CultureInfo
Analyzer.Utilities.UnitTests (1)
aspire (78)
Backchannel\ExtensionBackchannel.cs (6)
159throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.InvalidSocketPath, endpoint));
211string.Format(CultureInfo.CurrentCulture, ErrorStrings.ExtensionIncompatibleWithCli,
227string.Format(CultureInfo.CurrentCulture, ErrorStrings.ExtensionIncompatibleWithCli,
424? throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText))
443return result ?? throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
463return result ?? throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
Commands\AddCommand.cs (5)
154_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, addPackageResult));
159_interactionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version));
191_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message));
229_interactionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoPackagesMatchedSearchTerm, searchTerm));
270string.Format(CultureInfo.CurrentCulture, AddCommandStrings.SelectAVersionOfPackage, selectedPackage.Package.Id),
Commands\ConfigCommand.cs (8)
89_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
149? string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeySetGlobally, key,
151: string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeySetLocally, key,
158_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorSettingConfiguration, ex.Message));
243_interactionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedGlobally, key));
247_interactionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedLocally, key));
254_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
260_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorDeletingConfiguration, ex.Message));
Templating\DotNetTemplateFactory.cs (6)
150interactionService.DisplayMessage("check_mark", string.Format(CultureInfo.CurrentCulture, TemplatingStrings.PromptForTFM_UsingForTesting, testFramework));
226interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.TemplateInstallationFailed, templateInstallResult.ExitCode));
230interactionService.DisplayMessage($"package", string.Format(CultureInfo.CurrentCulture, TemplatingStrings.UsingProjectTemplatesVersion, templateInstallResult.TemplateVersion));
257interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.ProjectCreationFailed, newProjectExitCode));
263interactionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.ProjectCreatedSuccessfully, outputPath));
274interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message));
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Confluent.Kafka (1)
Aspire.Dashboard (129)
Components\Pages\Traces.razor.cs (7)
100var tooltip = string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesFullName)], trace.FullName);
101tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTraceId)], trace.TraceId);
111var tooltip = string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesResourceSpans)], GetResourceName(applicationSpans.Application));
112tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTotalTraces)], count);
115tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTotalErroredTraces)], errorCount);
132string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.MessageExceededLimitBody)], DashboardOptions.Value.TelemetryLimits.MaxTraceCount),
251CultureInfo.CurrentCulture,
Model\DashboardCommandExecutor.cs (3)
110Title = string.Format(CultureInfo.InvariantCulture, loc[nameof(Dashboard.Resources.Resources.ResourceCommandStarting)], messageResourceName, command.GetDisplayName(commandsLoc)),
150toastParameters.Title = string.Format(CultureInfo.InvariantCulture, loc[nameof(Dashboard.Resources.Resources.ResourceCommandSuccess)], messageResourceName, command.GetDisplayName(commandsLoc));
156toastParameters.Title = string.Format(CultureInfo.InvariantCulture, loc[nameof(Dashboard.Resources.Resources.ResourceCommandFailed)], messageResourceName, command.GetDisplayName(commandsLoc));
Utils\FormatHelpers.cs (10)
33private static MillisecondFormatStrings GetMillisecondFormatStrings(CultureInfo cultureInfo)
70private static MillisecondFormatString GetLongTimePatternWithMilliseconds(CultureInfo cultureInfo) => GetMillisecondFormatStrings(cultureInfo).LongTimePattern;
72private static MillisecondFormatString GetShortDateLongTimePatternWithMilliseconds(CultureInfo cultureInfo) => GetMillisecondFormatStrings(cultureInfo).ShortDateLongTimePattern;
74public static string FormatTime(BrowserTimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
76cultureInfo ??= CultureInfo.CurrentCulture;
89public static string FormatDateTime(BrowserTimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
91cultureInfo ??= CultureInfo.CurrentCulture;
104public static string FormatTimeWithOptionalDate(BrowserTimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
122public static string FormatNumberWithOptionalDecimalPlaces(double value, int maxDecimalPlaces, CultureInfo? provider = null)
134return value.ToString(formatString, provider ?? CultureInfo.CurrentCulture);
Aspire.Dashboard.Components.Tests (21)
Aspire.Dashboard.Tests (20)
FormatHelpersTests.cs (7)
22Assert.Equal(expected, FormatHelpers.FormatNumberWithOptionalDecimalPlaces(value, maxDecimalPlaces: 6, CultureInfo.InvariantCulture));
33Assert.Equal(expected, FormatHelpers.FormatNumberWithOptionalDecimalPlaces(value, maxDecimalPlaces: 6, CultureInfo.GetCultureInfo("de-DE")));
45Assert.Equal(expected, FormatHelpers.FormatDateTime(CreateTimeProvider(), date, includeMilliseconds, cultureInfo: CultureInfo.InvariantCulture));
57Assert.Equal(expected, FormatHelpers.FormatDateTime(CreateTimeProvider(), date, includeMilliseconds, cultureInfo: CultureInfo.GetCultureInfo("de-DE")));
69Assert.Equal(expected, FormatHelpers.FormatDateTime(CreateTimeProvider(), date, includeMilliseconds, cultureInfo: CultureInfo.GetCultureInfo("fi-FI")));
82Assert.Equal(expected, FormatHelpers.FormatDateTime(CreateTimeProvider(), date, includeMilliseconds, cultureInfo: CultureInfo.GetCultureInfo("en-NZ")), ignoreWhiteSpaceDifferences: true, ignoreCase: true);
87Assert.True(DateTime.TryParseExact(value, "o", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out var date));
Aspire.EndToEnd.Tests (3)
Aspire.Hosting (34)
ApplicationModel\ExpressionResolver.cs (3)
70(EndpointProperty.Url, _, _) => string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}",
74(EndpointProperty.HostAndPort, _, _) => string.Format(CultureInfo.InvariantCulture, "{0}:{1}",
99var value = expr.Format.Length == 0 ? null : string.Format(CultureInfo.InvariantCulture, expr.Format, args);
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.AppService (2)
Aspire.Hosting.Azure.CosmosDB (1)
Aspire.Hosting.Azure.Functions (5)
Aspire.Hosting.Azure.Tests (1)
Aspire.Hosting.Docker (6)
Aspire.Hosting.Garnet (1)
Aspire.Hosting.Kubernetes (6)
Aspire.Hosting.MongoDB (1)
Aspire.Hosting.NodeJs.Tests (2)
Aspire.Hosting.Redis (2)
Aspire.Hosting.SqlServer (1)
Aspire.Hosting.Testing (6)
DistributedApplicationHostingTestingExtensions.cs (4)
52throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.ResourceDoesNotExposeConnectionStringExceptionMessage, resourceName), nameof(resourceName));
85throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.ResourceNotFoundExceptionMessage, resourceName), nameof(resourceName));
96throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.ResourceHasNoAllocatedEndpointsExceptionMessage, resourceName), nameof(resourceName));
111throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.EndpointForResourceNotFoundExceptionMessage, endpointName, resourceName), nameof(endpointName));
Aspire.Hosting.Testing.Tests (2)
Aspire.Hosting.Tests (40)
Dcp\DcpExecutorTests.cs (11)
320Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
353Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
409Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
443Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
477Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
888Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
923Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1003Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1039Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1076Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1113Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
Aspire.Hosting.Valkey (2)
Aspire.Microsoft.Data.SqlClient (3)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (3)
Aspire.Playground.Tests (2)
Aspire.StackExchange.Redis (1)
Aspire.Templates.Tests (3)
Aspire.TestUtilities (19)
AuthSamples.FunctionalTests (4)
CustomPolicyProviderTests.cs (4)
51var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
67var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 5)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
82var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 55)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
98var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
AzureFunctionsEndToEnd.Functions (4)
BasicTestApp (5)
BasicWebSite (11)
BinaryFormatTests (3)
BuildActionTelemetryTable (1)
BuildValidator (1)
ClaimsTransformation (1)
ClientSample (11)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
CodeGenerator (28)
HttpUtilities\HttpUtilities.cs (14)
46throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Generated {0} not found.", nameof(mask)));
61return string.Format(CultureInfo.InvariantCulture, @"// Licensed to the .NET Foundation under one or more agreements.
109result.AppendFormat(CultureInfo.InvariantCulture, " private static readonly ulong {0} = GetAsciiStringAsLong(\"{1}\");", httpMethodFieldName, methodInfo.MethodAsciiString.Replace("\0", "\\0"));
136result.AppendFormat(CultureInfo.InvariantCulture, """ private static readonly ulong {0} = GetMaskAsLong([{1}]);""", maskFieldName, hexMaskString);
161result.AppendFormat(CultureInfo.InvariantCulture, " SetKnownMethod({0}, {1}, HttpMethod.{3}, {4});", maskFieldName, httpMethodFieldName, typeof(String).Name, methodInfo.HttpMethod, methodInfo.MaskLength - 1);
184result.AppendFormat(CultureInfo.InvariantCulture, " _methodNames[(byte)HttpMethod.{1}] = {2}.{3};", typeof(String).Name, methodInfo.HttpMethod, typeof(HttpMethods).Name, methodInfo.HttpMethod);
215tmpReturn += string.Format(CultureInfo.InvariantCulture, "(tmp >> {1})", HttpUtilitiesGeneratorHelpers.MaskToHexString(item.Mask), item.Shift);
220string returnString = string.Format(CultureInfo.InvariantCulture, "return ({0}) & {1};", tmpReturn, HttpUtilitiesGeneratorHelpers.MaskToHexString(mask2));
222bodyString = string.Format(CultureInfo.InvariantCulture, " const int magicNumer = {0};\r\n var tmp = (int)value & magicNumer;\r\n {1}", HttpUtilitiesGeneratorHelpers.MaskToHexString(mask), returnString);
227bodyString = string.Format(CultureInfo.InvariantCulture, "return (int)(value & {0});", maskHexString);
235return string.Format(CultureInfo.InvariantCulture, "_http{0}MethodLong", methodsInfo.HttpMethod.ToString());
240return string.Format(CultureInfo.InvariantCulture, "_mask{0}Chars", nBytes);
251throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "MethodAsciiString {0} length is greather than {1}", method, length));
308Debug.Assert(str.Length == sizeof(ulong), string.Format(CultureInfo.InvariantCulture, "String must be exactly {0} (ASCII) characters long.", sizeof(ulong)));
HttpUtilities\HttpUtilitiesGeneratorHelpers.cs (4)
177result.AppendFormat(CultureInfo.InvariantCulture, "{0}{1:x2}", prefix, array[i]);
183result.AppendFormat(CultureInfo.InvariantCulture, "{0}{1:x2}", prefix, array[i]);
193return string.Format(CultureInfo.InvariantCulture, "0x{0:X" + hexMaskSize + "}", mask);
213return string.Format(CultureInfo.InvariantCulture, "0x{0:X" + (hexMaskSize == 0 ? 1 : hexMaskSize) + "}", mask);
src\Servers\Kestrel\shared\KnownHeaders.cs (10)
479public string FlagBit() => $"{"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L";
480public string TestBitCore(string name) => $"({name} & {"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L) != 0";
483public string TestNotTempBit() => $"(tempBits & ~{"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L) == 0";
484public string TestNotBit() => $"(_bits & {"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L) == 0";
485public string SetBit() => $"_bits |= {"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L";
486public string ClearBit() => $"_bits &= ~{"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L";
1160tempBits &= ~{"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
1176tempBits &= ~{"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
1249tempBits ^= {"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
1401")}_currentBits ^= {"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
ConfigurationSchemaGenerator (6)
ConfigurationSchemaGenerator.Tests (2)
ControllersFromServicesWebSite (1)
Crossgen2Tasks (2)
CustomPolicyProvider (2)
CustomResources.AppHost (1)
DemoConsole (2)
dotnet-dev-certs (17)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
dotnet-getdocument (12)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
dotnet-openapi (11)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
dotnet-sql-cache (15)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
dotnet-svcutil.xmlserializer (16)
dotnet-svcutil-lib (439)
CodeDomFixup\MethodCreationHelper.cs (7)
120string.Format(CultureInfo.InvariantCulture, comment, "///") +
126string.Format(CultureInfo.InvariantCulture, comment, "'''") +
211throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrBindingTypeNotSupportedFormat, binding.GetType().FullName));
1084throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrBindingElementNotSupportedFormat, bindingElement.GetType().FullName));
1632throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrEncodingNotSupportedFormat, encoding.WebName));
1658throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrMessageVersionNotSupportedFormat, messageVersion));
1676throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.ErrMessageVersionNotSupportedFormat, messagingVersion));
CommandProcessorOptions.cs (16)
347throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrInvalidOperationNoProjectFileFoundUnderFolderFormat, workingDirectory));
352var moreThanOneProjectMsg = string.Format(CultureInfo.CurrentCulture, SR.ErrMoreThanOneProjectFoundFormat, workingDirectory);
356var useProjectOptions = string.Format(CultureInfo.CurrentCulture, SR.UseProjectFileOptionOnMultipleFilesMsgFormat, Switches.ProjectFile.Name, projectItems);
441throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrOutputFileAlreadyExistsFormat, filePath, Switches.OutputFile.Name));
448string.Format(CultureInfo.CurrentCulture, SR.ErrOutputFileNotUnderOutputDirFormat, Switches.OutputFile.Name, outputFile, this.OutputDir, Switches.OutputDirectory.Name));
454this.AddWarning(string.Format(CultureInfo.CurrentCulture, SR.WrnSpecifiedFilePathNotUndeProjectDirFormat, Switches.OutputFile.Name, outputFile, this.Project.DirectoryPath));
474throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrInvalidOperationNoProjectFileFoundUnderFolderFormat, Directory.GetCurrentDirectory()));
478throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrProjectToUpdateNotFoundFormat, Switches.Update.Name, Switches.ProjectFile.Name));
509throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrNoUpdateParamsFileFoundFormat, this.Project.FullPath));
517throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrMoreThanOneUpdateParamsFilesFoundFormat, this.Project.FullPath, Switches.Update.Name, svcRefNames));
531throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrServiceReferenceNotFoundUnderProjectFormat, this.UpdateServiceReferenceFolder, this.Project.FullPath));
539throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrNoUpdateParamsFileFoundFormat, this.Project.FullPath));
576var sessionDirName = DateTime.Now.ToString("yyyy_MMM_dd_HH_mm_ss", CultureInfo.InvariantCulture);
663throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrInvalidNamespaceFormat,
674this.Project.EndOfLifeTargetFrameworks?.ToList().ForEach(tfx => this.AddWarning(string.Format(CultureInfo.CurrentCulture, SR.WrnOutOfSupportTargetFrameworkFormat, tfx)));
680this.AddWarning(string.Format(CultureInfo.CurrentCulture, SR.WrnOutOfSupportTargetFrameworkFormat, this.TargetFramework.FullName));
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (12)
581ce.Line = int.Parse(m.Groups[4].Value, CultureInfo.InvariantCulture);
582ce.Column = int.Parse(m.Groups[5].Value, CultureInfo.InvariantCulture);
1461Output.Write(((int)value).ToString("X4", CultureInfo.InvariantCulture));
1466b.Append(((int)value).ToString("X4", CultureInfo.InvariantCulture));
2297Output.Write(s.ToString("R", CultureInfo.InvariantCulture));
2318Output.Write(d.ToString("R", CultureInfo.InvariantCulture));
2326Output.Write(d.ToString("F" + CultureInfo.CurrentCulture.NumberFormat.NumberDecimalDigits, CultureInfo.InvariantCulture));
3416Output.Write(b.ToString("X2", CultureInfo.InvariantCulture));
3898&& -1 != CultureInfo.InvariantCulture.CompareInfo.IndexOf(options.CompilerOptions, "/debug:pdbonly", CompareOptions.IgnoreCase))
4626public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
4651public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (7)
239bufBld.Append(u.ToString("X8", CultureInfo.InvariantCulture));
245bufBld.Append(((Int32)name[0]).ToString("X4", CultureInfo.InvariantCulture));
284bufBld.Append(u.ToString("X8", CultureInfo.InvariantCulture));
290bufBld.Append(((Int32)name[position]).ToString("X4", CultureInfo.InvariantCulture));
1822((uint)hi).ToString( "X", CultureInfo.InvariantCulture ),
1823((uint)low).ToString( "X", CultureInfo.InvariantCulture )
1840return CreateException(ResXml.Xml_InvalidSurrogateHighChar, ((uint)hi).ToString("X", CultureInfo.InvariantCulture), exceptionType, lineNo, linePos);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (5)
1710namespaces.Insert(0, count.ToString(CultureInfo.InvariantCulture)).Insert(0, " ");
1757nestedParamCounts.Add(Int32.Parse(typeName.Substring(endIndex + 1), CultureInfo.InvariantCulture));
1761nestedParamCounts.Add(Int32.Parse(typeName.Substring(endIndex + 1, startIndex - endIndex - 1), CultureInfo.InvariantCulture));
1813return !type.GetTypeInfo().IsGenericTypeDefinition && type.GetTypeInfo().ContainsGenericParameters ? String.Format(CultureInfo.InvariantCulture, "{0}.{1}", type.Namespace, type.Name) : type.FullName;
2031namespaces.Insert(0, count.ToString(CultureInfo.InvariantCulture)).Insert(0, " ");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
246DictionaryGlobals.SerializationNamespace, string.Format(CultureInfo.InvariantCulture, "{0}{1}", "i", objectId));
251xmlWriter.WriteAttributeString(Globals.SerPrefix, DictionaryGlobals.RefLocalName, DictionaryGlobals.SerializationNamespace, string.Format(CultureInfo.InvariantCulture, "{0}{1}", "i", objectId));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBufferReader.cs (6)
474throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "DateTime", exception));
478throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "DateTime", exception));
482throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "DateTime", exception));
496throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "TimeSpan", exception));
500throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "TimeSpan", exception));
504throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "TimeSpan", exception));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityBindingElement.cs (11)
1414sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "{0}:", this.GetType().ToString()));
1415sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "DefaultAlgorithmSuite: {0}", _defaultAlgorithmSuite.ToString()));
1416sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "IncludeTimestamp: {0}", _includeTimestamp.ToString()));
1417sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "KeyEntropyMode: {0}", _keyEntropyMode.ToString()));
1418sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "MessageSecurityVersion: {0}", this.MessageSecurityVersion.ToString()));
1419sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "SecurityHeaderLayout: {0}", _securityHeaderLayout.ToString()));
1420sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "ProtectTokens: {0}", _protectTokens.ToString()));
1427sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "OperationSupportingTokenParameters: none"));
1433sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "OperationSupportingTokenParameters[\"{0}\"]:", requestAction));
1439sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "OptionalOperationSupportingTokenParameters: none"));
1445sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "OptionalOperationSupportingTokenParameters[\"{0}\"]:", requestAction));
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientClassGenerator.cs (11)
177throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid client generation constructor table initialization")));
185throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid client generation constructor table initialization")));
945return string.Format(CultureInfo.InvariantCulture, "{0}Async", syncMethodName);
950return string.Format(CultureInfo.InvariantCulture, "onBegin{0}Delegate", syncMethodName);
955return string.Format(CultureInfo.InvariantCulture, "OnBegin{0}", syncMethodName);
960return string.Format(CultureInfo.InvariantCulture, "onEnd{0}Delegate", syncMethodName);
965return string.Format(CultureInfo.InvariantCulture, "OnEnd{0}", syncMethodName);
970return string.Format(CultureInfo.InvariantCulture, "on{0}CompletedDelegate", syncMethodName);
975return string.Format(CultureInfo.InvariantCulture, "On{0}Completed", syncMethodName);
980return string.Format(CultureInfo.InvariantCulture, "{0}Completed", syncMethodName);
985return string.Format(CultureInfo.InvariantCulture, "{0}CompletedEventArgs", syncMethodName);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlExporter.cs (11)
840return string.Format(CultureInfo.InvariantCulture, "#{0}", key);
874return string.Format(CultureInfo.InvariantCulture, "{0}_policy", wsdlBinding.Name);
879return string.Format(CultureInfo.InvariantCulture, "{0}_{1}_policy",
890return string.Format(CultureInfo.InvariantCulture, "{0}_{1}_Input_policy", wsdlBinding.Name, wsdlOperationBinding.Name);
892return string.Format(CultureInfo.InvariantCulture, "{0}_{1}_output_policy", wsdlBinding.Name, wsdlOperationBinding.Name);
901return string.Format(CultureInfo.InvariantCulture, "{0}_{1}_Fault", wsdlBinding.Name, wsdlOperationBinding.Name);
905return string.Format(CultureInfo.InvariantCulture, "{0}_{1}_{2}_Fault", wsdlBinding.Name, wsdlOperationBinding.Name, wsdlFaultBinding.Name);
974throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "You must pass at least one namespaceScope")));
991prefix = prefixBase + i.ToString(CultureInfo.InvariantCulture);
995prefix = prefixBase + (++i).ToString(CultureInfo.InvariantCulture);
1214endpointIdentifier = String.Format(CultureInfo.InvariantCulture,
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (17)
1067string actionUri = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}", baseActionUri, portTypeName, delimiter, operationMessageName.EncodedName);
1187XmlName xmlName = new XmlName(string.Format(CultureInfo.InvariantCulture, "{0}_{1}", wsdlPort.Service.Name, wsdlPort.Name), true /*isEncoded*/);
1348string id = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}_BindingAdHocPolicy", wsdlBinding.Name, name);
1349string newPolicyUris = string.Format(System.Globalization.CultureInfo.InvariantCulture, "#{0} {1}", id, policyUris).Trim();
1768string documentPath = string.Format(CultureInfo.InvariantCulture, xPathDocumentFormatString, wsdlNs);
1772itemPath = string.Format(CultureInfo.InvariantCulture, xPathNamedItemSubFormatString, localName, nameValue);
1816rest = string.Format(CultureInfo.InvariantCulture, xPathNamedItemSubFormatString, "port", item.Name);
1824rest = string.Format(CultureInfo.InvariantCulture, xPathNamedItemSubFormatString, "operation", item.Name);
1832rest = string.Format(CultureInfo.InvariantCulture, xPathNamedItemSubFormatString, "operation", item.Name);
1852rest = string.Format(CultureInfo.InvariantCulture, xPathNamedItemSubFormatString, "operation", wsdlOperationBinding.Name);
1854rest += string.Format(CultureInfo.InvariantCulture, xPathItemSubFormatString, messageTag);
1856rest += string.Format(CultureInfo.InvariantCulture, xPathNamedItemSubFormatString, messageTag, messageName);
2423string policyUri = string.Format(CultureInfo.InvariantCulture, "{0}{1}", identifier, policyId);
2432private static readonly string s_wspPolicy = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", MetadataStrings.WSPolicy.Prefix, MetadataStrings.WSPolicy.Elements.Policy);
2433private static readonly string s_xmlId = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", MetadataStrings.Xml.Prefix, MetadataStrings.Xml.Attributes.Id);
2434private static readonly string s_wsuId = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", MetadataStrings.Wsu.Prefix, MetadataStrings.Wsu.Attributes.Id);
2469return string.Format(CultureInfo.InvariantCulture, "{0}/{1}/[@{2}='{3}']", xPath, s_wspPolicy, idAttrib, key);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityTimestamp.cs (9)
146CultureInfo.InvariantCulture,
165throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampHasCreationAheadOfExpiry, this.CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), this.ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture))));
177throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampHasExpiryTimeInPast, this.ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew)));
183throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampHasCreationTimeInFuture, this.CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew)));
189throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampWasCreatedTooLongAgo, this.CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), timeToLive, allowedClockSkew)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\IssuedSecurityTokenParameters.cs (16)
23private static readonly string s_wsidPPIClaim = String.Format(CultureInfo.InvariantCulture, "{0}/claims/privatepersonalidentifier", wsidNamespace);
595sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "TokenType: {0}", _tokenType == null ? "null" : _tokenType));
596sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "KeyType: {0}", _keyType.ToString()));
597sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "KeySize: {0}", _keySize.ToString(CultureInfo.InvariantCulture)));
598sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "IssuerAddress: {0}", _issuerAddress == null ? "null" : _issuerAddress.ToString()));
599sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "IssuerMetadataAddress: {0}", _issuerMetadataAddress == null ? "null" : _issuerMetadataAddress.ToString()));
600sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "DefaultMessgeSecurityVersion: {0}", _defaultMessageSecurityVersion == null ? "null" : _defaultMessageSecurityVersion.ToString()));
601sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "UseStrTransform: {0}", _useStrTransform.ToString()));
605sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "IssuerBinding: null"));
609sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "IssuerBinding:"));
613sb.AppendLine(String.Format(CultureInfo.InvariantCulture, " BindingElement[{0}]:", i.ToString(CultureInfo.InvariantCulture)));
620sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "ClaimTypeRequirements: none"));
624sb.AppendLine(String.Format(CultureInfo.InvariantCulture, "ClaimTypeRequirements:"));
627sb.AppendLine(String.Format(CultureInfo.InvariantCulture, " {0}, optional={1}", _claimTypeRequirements[i].ClaimType, _claimTypeRequirements[i].IsOptional));
HelpGenerator.cs (5)
94s_helpBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", syntax));
95s_helpBuilder.AppendLine(paragraphHelper.AddIndentation(string.Format(CultureInfo.InvariantCulture, " {0}", explanation), indentLength: 4));
118_name = String.Format(CultureInfo.InvariantCulture, "{0}{1}", CommandSwitch.FullSwitchIndicator, option),
128_name = String.Format(CultureInfo.InvariantCulture, "{0}{1} {2}", CommandSwitch.FullSwitchIndicator, option, optionUse),
155return string.Format(CultureInfo.InvariantCulture, pattern, _name, _helpText);
Shared\Options\OptionValueParser.cs (8)
46else if (valueType == typeof(CultureInfo))
48value = CreateValue<CultureInfo>(() => new CultureInfo(stringValue), option, stringValue);
104else if (value is CultureInfo ci)
188else if (value is CultureInfo ci)
238var invalidValueError = string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidOptionValueFormat, value, option.Name);
239var supportedValues = string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorOnInvalidEnumSupportedValuesFormat, string.Join(", ", Enum.GetNames(typeof(TValue))));
271throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidOptionValueFormat, value, option.Name));
277throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidOptionValueFormat, value, option.Name), innerException);
Shared\ProjectDependency.cs (12)
77throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, filePath, nameof(filePath)));
82throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, packageName, nameof(packageName)));
91throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, packageVersion, nameof(packageVersion)));
96throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, dependencyType, nameof(dependencyType)));
104throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, packageName, nameof(packageName)));
110throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, packageName, nameof(packageName)));
120throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, packageName, nameof(packageName)));
127throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, filePath, nameof(filePath)));
140throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, filePath, nameof(filePath)));
155string.Format(CultureInfo.InvariantCulture, "{0}, {{{1}, {2}}}", this.AssemblyName, this.Name, this.Version) :
180throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorInvalidDependencyValue, dependencySpec, nameof(dependencySpec)));
273throw new FormatException(string.Format(CultureInfo.CurrentCulture, Shared.Resources.ErrorDepenencySpecFormat, dependencySpec));
dotnet-user-jwts (17)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
dotnet-user-secrets (13)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
FormatterWebSite (4)
GenerateDocumentationAndConfigFiles (14)
GenerateRulesMissingDocumentation (1)
GenericHostWebSite (3)
GetDocument.Insider (12)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
HelixTestRunner (3)
http2cat (6)
HttpStress (4)
Identity.ExternalClaims (2)
IIS.Common.TestLib (1)
IIS.FunctionalTests (28)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (6)
56stringBuilder.Append(i.ToString("X2", CultureInfo.InvariantCulture));
108Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
118var response = await SendSocketRequestAsync("/%" + i.ToString("X2", CultureInfo.InvariantCulture));
119Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
802var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
809var length = int.Parse(headers.Single(h => h.StartsWith("Content-Length: ", StringComparison.Ordinal)).Substring("Content-Length: ".Length), CultureInfo.InvariantCulture);
IIS.LongTests (8)
IIS.NewHandler.FunctionalTests (8)
IIS.NewShim.FunctionalTests (8)
IIS.ShadowCopy.Tests (7)
IISExpress.FunctionalTests (26)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (6)
56stringBuilder.Append(i.ToString("X2", CultureInfo.InvariantCulture));
108Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
118var response = await SendSocketRequestAsync("/%" + i.ToString("X2", CultureInfo.InvariantCulture));
119Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
802var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
809var length = int.Parse(headers.Single(h => h.StartsWith("Content-Length: ", StringComparison.Ordinal)).Substring("Content-Length: ".Length), CultureInfo.InvariantCulture);
illink (22)
Linker.Steps\ProcessLinkerXmlBase.cs (10)
557if (!byte.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out byte byteresult))
564if (!sbyte.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out sbyte sbyteresult))
571if (!short.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out short shortresult))
578if (!ushort.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out ushort ushortresult))
585if (!int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out int iresult))
592if (!uint.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out uint uresult))
599if (!double.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out double dresult))
606if (!float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out float fresult))
613if (!long.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out long lresult))
620if (!ulong.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out ulong ulresult))
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (9)
238/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo)"/></item>
239/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
245/// <item><see cref="System.Activator.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
253/// <item><see cref="System.Activator.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
261/// <item><see cref="System.AppDomain.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
269/// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
277/// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
285/// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
294/// <item><see cref="System.Reflection.Assembly.CreateInstance(string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
ILLink.CodeFixProvider (2)
ILLink.RoslynAnalyzer (10)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (9)
238/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo)"/></item>
239/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
245/// <item><see cref="System.Activator.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
253/// <item><see cref="System.Activator.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
261/// <item><see cref="System.AppDomain.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
269/// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
277/// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
285/// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
294/// <item><see cref="System.Reflection.Assembly.CreateInstance(string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
Infrastructure.Common (5)
InMemory.FunctionalTests (24)
ChunkedResponseTests.cs (7)
223length.ToString("x", CultureInfo.InvariantCulture),
264partialLength.ToString("x", CultureInfo.InvariantCulture),
698length.Value.ToString("x", CultureInfo.InvariantCulture),
754length.Value.ToString("x", CultureInfo.InvariantCulture),
811length.ToString("x", CultureInfo.InvariantCulture),
1095writeSize.ToString("X", CultureInfo.InvariantCulture).ToLowerInvariant(),
1134writeSize.ToString("X", CultureInfo.InvariantCulture).ToLowerInvariant(),
InProcessWebSite (7)
InteractiveHost.UnitTests (23)
InteractiveHostDesktopTests.cs (17)
706await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
744await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
769await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
820await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
847await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
1002await Host.ResetAsync(InteractiveHostOptions.CreateFromDirectory(TestUtils.HostRootPath, initializationFileName: null, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, InteractiveHostPlatform.Desktop32));
1010var result = await Host.ResetAsync(InteractiveHostOptions.CreateFromDirectory(TestUtils.HostRootPath, initializationFileName: null, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, InteractiveHostPlatform.Core));
1024var culture = new CultureInfo("cs-CZ");
1025var uiCulture = CultureInfo.CurrentUICulture;
InteractiveHost32 (7)
InteractiveHost64 (7)
Interop.FunctionalTests (2)
InteropClient (2)
KeyManagementSimulator (1)
LocalizationSample (18)
Startup.cs (18)
92await context.Response.WriteAsync($"<tr><th>{SR["Current thread culture:"]}</th><td>{CultureInfo.CurrentCulture.DisplayName} ({CultureInfo.CurrentCulture})</td></tr>");
93await context.Response.WriteAsync($"<tr><th>{SR["Current thread UI culture:"]}</th><td>{CultureInfo.CurrentUICulture.DisplayName} ({CultureInfo.CurrentUICulture})</td></tr>");
94await context.Response.WriteAsync($"<tr><th>{SR["Current date (invariant full):"]}</th><td>{DateTime.Now.ToString("F", CultureInfo.InvariantCulture)}</td></tr>");
95await context.Response.WriteAsync($"<tr><th>{SR["Current date (invariant):"]}</th><td>{DateTime.Now.ToString(CultureInfo.InvariantCulture)}</td></tr>");
96await context.Response.WriteAsync($"<tr><th>{SR["Current date (request full):"]}</th><td>{DateTime.Now.ToString("F", CultureInfo.CurrentCulture)}</td></tr>");
97await context.Response.WriteAsync($"<tr><th>{SR["Current date (request):"]}</th><td>{DateTime.Now.ToString(CultureInfo.CurrentCulture)}</td></tr>");
98await context.Response.WriteAsync($"<tr><th>{SR["Current time (invariant):"]}</th><td>{DateTime.Now.ToString("T", CultureInfo.InvariantCulture)}</td></tr>");
99await context.Response.WriteAsync($"<tr><th>{SR["Current time (request):"]}</th><td>{DateTime.Now.ToString("T", CultureInfo.CurrentCulture)}</td></tr>");
100await context.Response.WriteAsync($"<tr><th>{SR["Big number (invariant):"]}</th><td>{(Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.InvariantCulture)}</td></tr>");
101await context.Response.WriteAsync($"<tr><th>{SR["Big number (request):"]}</th><td>{(Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.CurrentCulture)}</td></tr>");
102await context.Response.WriteAsync($"<tr><th>{SR["Big number negative (invariant):"]}</th><td>{(-Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.InvariantCulture)}</td></tr>");
103await context.Response.WriteAsync($"<tr><th>{SR["Big number negative (request):"]}</th><td>{(-Math.Pow(2, 42) + 0.42).ToString("N", CultureInfo.CurrentCulture)}</td></tr>");
104await context.Response.WriteAsync($"<tr><th>{SR["Money (invariant):"]}</th><td>{2199.50.ToString("C", CultureInfo.InvariantCulture)}</td></tr>");
105await context.Response.WriteAsync($"<tr><th>{SR["Money (request):"]}</th><td>{2199.50.ToString("C", CultureInfo.CurrentCulture)}</td></tr>");
106await context.Response.WriteAsync($"<tr><th>{SR["Money negative (invariant):"]}</th><td>{(-2199.50).ToString("C", CultureInfo.InvariantCulture)}</td></tr>");
107await context.Response.WriteAsync($"<tr><th>{SR["Money negative (request):"]}</th><td>{(-2199.50).ToString("C", CultureInfo.CurrentCulture)}</td></tr>");
LocalizationWebsite (13)
Metrics (9)
MetricsOutputWriter.cs (7)
87writer.WriteAttributeString("Line", (location.GetLineSpan().StartLinePosition.Line + 1).ToString(CultureInfo.InvariantCulture));
100WriteMetric("MaintainabilityIndex", data.MaintainabilityIndex.ToString(CultureInfo.InvariantCulture), writer);
101WriteMetric("CyclomaticComplexity", data.CyclomaticComplexity.ToString(CultureInfo.InvariantCulture), writer);
102WriteMetric("ClassCoupling", data.CoupledNamedTypes.Count.ToString(CultureInfo.InvariantCulture), writer);
105WriteMetric("DepthOfInheritance", data.DepthOfInheritance.Value.ToString(CultureInfo.InvariantCulture), writer);
113WriteMetric("SourceLines", data.SourceLines.ToString(CultureInfo.InvariantCulture), writer);
114WriteMetric("ExecutableLines", data.ExecutableLines.ToString(CultureInfo.InvariantCulture), writer);
Metrics.Legacy (8)
src\RoslynAnalyzers\Tools\Metrics\MetricsOutputWriter.cs (6)
87writer.WriteAttributeString("Line", (location.GetLineSpan().StartLinePosition.Line + 1).ToString(CultureInfo.InvariantCulture));
100WriteMetric("MaintainabilityIndex", data.MaintainabilityIndex.ToString(CultureInfo.InvariantCulture), writer);
101WriteMetric("CyclomaticComplexity", data.CyclomaticComplexity.ToString(CultureInfo.InvariantCulture), writer);
102WriteMetric("ClassCoupling", data.CoupledNamedTypes.Count.ToString(CultureInfo.InvariantCulture), writer);
105WriteMetric("DepthOfInheritance", data.DepthOfInheritance.Value.ToString(CultureInfo.InvariantCulture), writer);
111WriteMetric("LinesOfCode", data.ExecutableLines.ToString(CultureInfo.InvariantCulture), writer);
Microsoft.Analyzers.Extra (2)
Microsoft.Analyzers.Local (8)
Microsoft.Analyzers.Local.Tests (5)
Microsoft.Arcade.Common (2)
Microsoft.AspNetCore.Analyzer.Testing (1)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.App.Analyzers (17)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (7)
88new TextChange(new TextSpan(int.Parse(startString, CultureInfo.InvariantCulture), int.Parse(lengthString, CultureInfo.InvariantCulture)), newText),
89newPositionString == null ? null : int.Parse(newPositionString, CultureInfo.InvariantCulture)));
259properties.Add(StartKey, textChange.Span.Start.ToString(CultureInfo.InvariantCulture));
260properties.Add(LengthKey, textChange.Span.Length.ToString(CultureInfo.InvariantCulture));
266properties.Add(NewPositionKey, change.NewPosition.Value.ToString(CultureInfo.InvariantCulture));
270var sortText = routePatternCompletionContext.Items.Count.ToString("0000", CultureInfo.InvariantCulture);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (7)
82new TextChange(new TextSpan(int.Parse(startString, CultureInfo.InvariantCulture), int.Parse(lengthString, CultureInfo.InvariantCulture)), newText),
83newPositionString == null ? null : int.Parse(newPositionString, CultureInfo.InvariantCulture)));
138properties.Add(StartKey, textChange.Span.Start.ToString(CultureInfo.InvariantCulture));
139properties.Add(LengthKey, textChange.Span.Length.ToString(CultureInfo.InvariantCulture));
145properties.Add(NewPositionKey, change.NewPosition.Value.ToString(CultureInfo.InvariantCulture));
149var sortText = routePatternCompletionContext.Items.Count.ToString("0000", CultureInfo.InvariantCulture);
Microsoft.AspNetCore.App.Analyzers.Test (61)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (5)
124throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Saw multiple occurrences of {0}", PositionString));
137throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Saw {0} without matching {1}", SpanEndString, SpanStartString));
151throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Saw {0} without matching {1}", NamedSpanEndString, NamedSpanStartString));
164throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Saw {0} without matching {1}", SpanStartString, SpanEndString));
169throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Saw {0} without matching {1}", NamedSpanEndString, NamedSpanEndString));
RouteEmbeddedLanguage\RoutePatternAnalyzerTests.cs (11)
47Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture));
79Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture));
112Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture));
140Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture));
168Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture));
197Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture));
228Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.FormatTemplateRoute_InvalidLiteral("~hi?")), d.GetMessage(CultureInfo.InvariantCulture));
233Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), d.GetMessage(CultureInfo.InvariantCulture));
295Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.AttributeRoute_TokenReplacement_UnclosedToken), d.GetMessage(CultureInfo.InvariantCulture));
335Assert.Equal(Resources.FormatAnalyzer_UnusedParameter_Message("id"), d.GetMessage(CultureInfo.InvariantCulture));
489Assert.Equal(Resources.FormatAnalyzer_UnusedParameter_Message("id"), d.GetMessage(CultureInfo.InvariantCulture));
Microsoft.AspNetCore.App.CodeFixes (2)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Abstractions (3)
Microsoft.AspNetCore.Authentication.Cookies (8)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (8)
75if (int.TryParse(value.AsSpan(ChunkCountPrefix.Length), NumberStyles.None, CultureInfo.InvariantCulture, out var chunksCount))
103var chunk = requestCookies[key + ChunkKeySuffix + chunkId.ToString(CultureInfo.InvariantCulture)];
115CultureInfo.CurrentCulture,
200keyValuePairs[0] = KeyValuePair.Create(key, ChunkCountPrefix + cookieChunkCount.ToString(CultureInfo.InvariantCulture));
209keyValuePairs[chunkId] = KeyValuePair.Create(string.Concat(key, ChunkKeySuffix, chunkId.ToString(CultureInfo.InvariantCulture)), segment);
243var subkey = key + ChunkKeySuffix + i.ToString(CultureInfo.InvariantCulture);
301keyValuePairs[i] = KeyValuePair.Create(string.Concat(key, "C", i.ToString(CultureInfo.InvariantCulture)), string.Empty);
319var subkey = key + ChunkKeySuffix + i.ToString(CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Authentication.Core.Test (1)
Microsoft.AspNetCore.Authentication.Facebook (1)
Microsoft.AspNetCore.Authentication.Google (2)
Microsoft.AspNetCore.Authentication.JwtBearer (6)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (2)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.OAuth (5)
Microsoft.AspNetCore.Authentication.OpenIdConnect (12)
OpenIdConnectHandler.cs (9)
433.ToString(CultureInfo.InvariantCulture);
1136if (int.TryParse(message.ExpiresIn, NumberStyles.Integer, CultureInfo.InvariantCulture, out int value))
1141tokens.Add(new AuthenticationToken { Name = "expires_at", Value = expiresAt.ToString("o", CultureInfo.InvariantCulture) });
1386throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.UnableToValidateToken, idToken));
1409throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.ValidatedSecurityTokenNotJwt, validatedToken?.GetType()));
1415throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.UnableToValidateToken, idToken));
1464throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.UnableToValidateTokenFromHandler, idToken));
1470throw new SecurityTokenException(string.Format(CultureInfo.InvariantCulture, Resources.ValidatedSecurityTokenNotJsonWebToken, validatedToken?.GetType()));
1524CultureInfo.InvariantCulture,
Microsoft.AspNetCore.Authentication.Test (17)
OpenIdConnect\OpenIdConnectTests.cs (8)
410Assert.Equal(DateTime.MaxValue, GetNonceExpirationTime(noncePrefix + DateTime.MaxValue.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1)));
412Assert.Equal(DateTime.MinValue + TimeSpan.FromHours(1), GetNonceExpirationTime(noncePrefix + DateTime.MinValue.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1)));
414Assert.Equal(utcNow + TimeSpan.FromHours(1), GetNonceExpirationTime(noncePrefix + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1)));
422Assert.Equal(utcNow + TimeSpan.FromHours(1), GetNonceExpirationTime(noncePrefix + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1)));
424Assert.Equal(DateTime.MinValue, GetNonceExpirationTime(utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter + utcNow.Ticks.ToString(CultureInfo.InvariantCulture) + nonceDelimiter, TimeSpan.FromHours(1)));
588nonceTime = DateTime.FromBinary(Convert.ToInt64(timestamp, CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Authentication.Twitter (7)
Microsoft.AspNetCore.Authentication.WsFederation (1)
Microsoft.AspNetCore.Authorization (1)
Microsoft.AspNetCore.Authorization.Policy (1)
Microsoft.AspNetCore.BrowserTesting (1)
Microsoft.AspNetCore.Components (431)
BindConverter.cs (292)
26private delegate object? BindFormatter<T>(T value, CultureInfo? culture);
28internal delegate bool BindParser<T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value);
29internal delegate bool BindParserWithFormat<T>(object? obj, CultureInfo? culture, string? format, [MaybeNullWhen(false)] out T value);
36/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
40public static string? FormatValue(string? value, CultureInfo? culture = null) => FormatStringValueCore(value, culture);
42private static string? FormatStringValueCore(string? value, CultureInfo? _)
52/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
56public static bool FormatValue(bool value, CultureInfo? culture = null)
64private static object FormatBoolValueCore(bool value, CultureInfo? _)
76/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
80public static bool? FormatValue(bool? value, CultureInfo? culture = null)
88private static object? FormatNullableBoolValueCore(bool? value, CultureInfo? _)
100/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
104public static string? FormatValue(int value, CultureInfo? culture = null) => FormatIntValueCore(value, culture);
106private static string? FormatIntValueCore(int value, CultureInfo? culture)
108return value.ToString(culture ?? CultureInfo.CurrentCulture);
116/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
120public static string? FormatValue(int? value, CultureInfo? culture = null) => FormatNullableIntValueCore(value, culture);
122private static string? FormatNullableIntValueCore(int? value, CultureInfo? culture)
129return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
137/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
141public static string FormatValue(long value, CultureInfo? culture = null) => FormatLongValueCore(value, culture);
143private static string FormatLongValueCore(long value, CultureInfo? culture)
145return value.ToString(culture ?? CultureInfo.CurrentCulture);
153/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
157public static string? FormatValue(long? value, CultureInfo? culture = null) => FormatNullableLongValueCore(value, culture);
159private static string? FormatNullableLongValueCore(long? value, CultureInfo? culture)
166return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
174/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
178public static string FormatValue(short value, CultureInfo? culture = null) => FormatShortValueCore(value, culture);
180private static string FormatShortValueCore(short value, CultureInfo? culture)
182return value.ToString(culture ?? CultureInfo.CurrentCulture);
190/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
194public static string? FormatValue(short? value, CultureInfo? culture = null) => FormatNullableShortValueCore(value, culture);
196private static string? FormatNullableShortValueCore(short? value, CultureInfo? culture)
203return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
211/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
215public static string FormatValue(float value, CultureInfo? culture = null) => FormatFloatValueCore(value, culture);
217private static string FormatFloatValueCore(float value, CultureInfo? culture)
219return value.ToString(culture ?? CultureInfo.CurrentCulture);
227/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
231public static string? FormatValue(float? value, CultureInfo? culture = null) => FormatNullableFloatValueCore(value, culture);
233private static string? FormatNullableFloatValueCore(float? value, CultureInfo? culture)
240return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
248/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
252public static string? FormatValue(double value, CultureInfo? culture = null) => FormatDoubleValueCore(value, culture);
254private static string FormatDoubleValueCore(double value, CultureInfo? culture)
256return value.ToString(culture ?? CultureInfo.CurrentCulture);
264/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
268public static string? FormatValue(double? value, CultureInfo? culture = null) => FormatNullableDoubleValueCore(value, culture);
270private static string? FormatNullableDoubleValueCore(double? value, CultureInfo? culture)
277return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
285/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
289public static string FormatValue(decimal value, CultureInfo? culture = null) => FormatDecimalValueCore(value, culture);
291private static string FormatDecimalValueCore(decimal value, CultureInfo? culture)
293return value.ToString(culture ?? CultureInfo.CurrentCulture);
301/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
305public static string? FormatValue(decimal? value, CultureInfo? culture = null) => FormatNullableDecimalValueCore(value, culture);
307private static string? FormatNullableDecimalValueCore(decimal? value, CultureInfo? culture)
314return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
322/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
326public static string FormatValue(DateTime value, CultureInfo? culture = null) => FormatDateTimeValueCore(value, format: null, culture);
334/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
338public static string FormatValue(DateTime value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, CultureInfo? culture = null) => FormatDateTimeValueCore(value, format, culture);
340private static string FormatDateTimeValueCore(DateTime value, string? format, CultureInfo? culture)
344return value.ToString(format, culture ?? CultureInfo.CurrentCulture);
347return value.ToString(culture ?? CultureInfo.CurrentCulture);
350private static string FormatDateTimeValueCore(DateTime value, CultureInfo? culture)
352return value.ToString(culture ?? CultureInfo.CurrentCulture);
360/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
364public static string? FormatValue(DateTime? value, CultureInfo? culture = null) => FormatNullableDateTimeValueCore(value, format: null, culture);
372/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
376public static string? FormatValue(DateTime? value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string? format, CultureInfo? culture = null) => FormatNullableDateTimeValueCore(value, format, culture);
378private static string? FormatNullableDateTimeValueCore(DateTime? value, string? format, CultureInfo? culture)
387return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture);
390return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
393private static string? FormatNullableDateTimeValueCore(DateTime? value, CultureInfo? culture)
400return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
408/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
412public static string FormatValue(DateTimeOffset value, CultureInfo? culture = null) => FormatDateTimeOffsetValueCore(value, format: null, culture);
420/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
424public static string FormatValue(DateTimeOffset value, string format, CultureInfo? culture = null) => FormatDateTimeOffsetValueCore(value, format, culture);
426private static string FormatDateTimeOffsetValueCore(DateTimeOffset value, string? format, CultureInfo? culture)
430return value.ToString(format, culture ?? CultureInfo.CurrentCulture);
433return value.ToString(culture ?? CultureInfo.CurrentCulture);
436private static string FormatDateTimeOffsetValueCore(DateTimeOffset value, CultureInfo? culture)
438return value.ToString(culture ?? CultureInfo.CurrentCulture);
446/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
450public static string? FormatValue(DateTimeOffset? value, CultureInfo? culture = null) => FormatNullableDateTimeOffsetValueCore(value, format: null, culture);
458/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
462public static string? FormatValue(DateTimeOffset? value, string format, CultureInfo? culture = null) => FormatNullableDateTimeOffsetValueCore(value, format, culture);
464private static string? FormatNullableDateTimeOffsetValueCore(DateTimeOffset? value, string? format, CultureInfo? culture)
473return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture);
476return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
479private static string? FormatNullableDateTimeOffsetValueCore(DateTimeOffset? value, CultureInfo? culture)
486return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
494/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
498public static string FormatValue(DateOnly value, CultureInfo? culture = null) => FormatDateOnlyValueCore(value, format: null, culture);
506/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
510public static string FormatValue(DateOnly value, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, CultureInfo? culture = null) => FormatDateOnlyValueCore(value, format, culture);
512private static string FormatDateOnlyValueCore(DateOnly value, string? format, CultureInfo? culture)
517return value.ToDateTime(TimeOnly.MinValue).ToString(format, culture ?? CultureInfo.CurrentCulture);
520return value.ToString(culture ?? CultureInfo.CurrentCulture);
523private static string FormatDateOnlyValueCore(DateOnly value, CultureInfo? culture)
525return value.ToString(culture ?? CultureInfo.CurrentCulture);
533/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
537public static string? FormatValue(DateOnly? value, CultureInfo? culture = null) => FormatNullableDateOnlyValueCore(value, format: null, culture);
545/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
549public static string? FormatValue(DateOnly? value, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, CultureInfo? culture = null) => FormatNullableDateOnlyValueCore(value, format, culture);
551private static string? FormatNullableDateOnlyValueCore(DateOnly? value, string? format, CultureInfo? culture)
561return value.Value.ToDateTime(TimeOnly.MinValue).ToString(format, culture ?? CultureInfo.CurrentCulture);
564return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
567private static string? FormatNullableDateOnlyValueCore(DateOnly? value, CultureInfo? culture)
574return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
582/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
586public static string FormatValue(TimeOnly value, CultureInfo? culture = null) => FormatTimeOnlyValueCore(value, format: null, culture);
594/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
598public static string FormatValue(TimeOnly value, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, CultureInfo? culture = null) => FormatTimeOnlyValueCore(value, format, culture);
600private static string FormatTimeOnlyValueCore(TimeOnly value, string? format, CultureInfo? culture)
605return DateTime.MinValue.Add(value.ToTimeSpan()).ToString(format, culture ?? CultureInfo.CurrentCulture);
608return value.ToString(culture ?? CultureInfo.CurrentCulture);
611private static string FormatTimeOnlyValueCore(TimeOnly value, CultureInfo? culture)
613return value.ToString(culture ?? CultureInfo.CurrentCulture);
621/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
625public static string? FormatValue(TimeOnly? value, CultureInfo? culture = null) => FormatNullableTimeOnlyValueCore(value, format: null, culture);
633/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
637public static string? FormatValue(TimeOnly? value, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, CultureInfo? culture = null) => FormatNullableTimeOnlyValueCore(value, format, culture);
639private static string? FormatNullableTimeOnlyValueCore(TimeOnly? value, string? format, CultureInfo? culture)
649return DateTime.MinValue.Add(value.Value.ToTimeSpan()).ToString(format, culture ?? CultureInfo.CurrentCulture);
652return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
655private static string? FormatNullableTimeOnlyValueCore(TimeOnly? value, CultureInfo? culture)
662return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
665private static string? FormatEnumValueCore<T>(T value, CultureInfo? _)
680/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
684public static object? FormatValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(T value, CultureInfo? culture = null)
694/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
697public static bool TryConvertToString(object? obj, CultureInfo? culture, out string? value)
704private static bool ConvertToStringCore(object? obj, CultureInfo? culture, out string? value)
715/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
718public static bool TryConvertToBool(object? obj, CultureInfo? culture, out bool value)
727/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
730public static bool TryConvertToNullableBool(object? obj, CultureInfo? culture, out bool? value)
738private static bool ConvertToBoolCore(object? obj, CultureInfo? culture, out bool value)
745private static bool ConvertToNullableBoolCore(object? obj, CultureInfo? culture, out bool? value)
756/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
759public static bool TryConvertToInt(object? obj, CultureInfo? culture, out int value)
768/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
771public static bool TryConvertToNullableInt(object? obj, CultureInfo? culture, out int? value)
779private static bool ConvertToIntCore(object? obj, CultureInfo? culture, out int value)
788if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
798private static bool ConvertToNullableIntCore(object? obj, CultureInfo? culture, out int? value)
807if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
821/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
824public static bool TryConvertToLong(object? obj, CultureInfo? culture, out long value)
833/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
836public static bool TryConvertToNullableLong(object? obj, CultureInfo? culture, out long? value)
844private static bool ConvertToLongCore(object? obj, CultureInfo? culture, out long value)
853if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
863private static bool ConvertToNullableLongCore(object? obj, CultureInfo? culture, out long? value)
872if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
886/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
889public static bool TryConvertToShort(object? obj, CultureInfo? culture, out short value)
898/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
901public static bool TryConvertToNullableShort(object? obj, CultureInfo? culture, out short? value)
909private static bool ConvertToShortCore(object? obj, CultureInfo? culture, out short value)
918if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
928private static bool ConvertToNullableShortCore(object? obj, CultureInfo? culture, out short? value)
937if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
951/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
954public static bool TryConvertToFloat(object? obj, CultureInfo? culture, out float value)
963/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
966public static bool TryConvertToNullableFloat(object? obj, CultureInfo? culture, out float? value)
974private static bool ConvertToFloatCore(object? obj, CultureInfo? culture, out float value)
983if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
999private static bool ConvertToNullableFloatCore(object? obj, CultureInfo? culture, out float? value)
1008if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1028/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1031public static bool TryConvertToDouble(object? obj, CultureInfo? culture, out double value)
1040/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1043public static bool TryConvertToNullableDouble(object? obj, CultureInfo? culture, out double? value)
1051private static bool ConvertToDoubleCore(object? obj, CultureInfo? culture, out double value)
1060if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1076private static bool ConvertToNullableDoubleCore(object? obj, CultureInfo? culture, out double? value)
1085if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1105/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1108public static bool TryConvertToDecimal(object? obj, CultureInfo? culture, out decimal value)
1117/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1120public static bool TryConvertToNullableDecimal(object? obj, CultureInfo? culture, out decimal? value)
1128private static bool ConvertToDecimalCore(object? obj, CultureInfo? culture, out decimal value)
1137if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1147private static bool ConvertToNullableDecimalCore(object? obj, CultureInfo? culture, out decimal? value)
1156if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1170/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1173public static bool TryConvertToDateTime(object? obj, CultureInfo? culture, out DateTime value)
1182/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1186public static bool TryConvertToDateTime(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, out DateTime value)
1195/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1198public static bool TryConvertToNullableDateTime(object? obj, CultureInfo? culture, out DateTime? value)
1207/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1211public static bool TryConvertToNullableDateTime(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, out DateTime? value)
1221private static bool ConvertToDateTimeCore(object? obj, CultureInfo? culture, out DateTime value)
1226private static bool ConvertToDateTimeCore(object? obj, CultureInfo? culture, string? format, out DateTime value)
1235if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1240else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1250private static bool ConvertToNullableDateTimeCore(object? obj, CultureInfo? culture, out DateTime? value)
1255private static bool ConvertToNullableDateTimeCore(object? obj, CultureInfo? culture, string? format, out DateTime? value)
1264if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1269else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1283/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1286public static bool TryConvertToDateTimeOffset(object? obj, CultureInfo? culture, out DateTimeOffset value)
1295/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1299public static bool TryConvertToDateTimeOffset(object? obj, CultureInfo? culture, string format, out DateTimeOffset value)
1308/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1311public static bool TryConvertToNullableDateTimeOffset(object? obj, CultureInfo? culture, out DateTimeOffset? value)
1320/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1324public static bool TryConvertToNullableDateTimeOffset(object? obj, CultureInfo? culture, string format, out DateTimeOffset? value)
1334private static bool ConvertToDateTimeOffsetCore(object? obj, CultureInfo? culture, out DateTimeOffset value)
1339private static bool ConvertToDateTimeOffsetCore(object? obj, CultureInfo? culture, string? format, out DateTimeOffset value)
1348if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1353else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1363private static bool ConvertToNullableDateTimeOffsetCore(object? obj, CultureInfo? culture, out DateTimeOffset? value)
1368private static bool ConvertToNullableDateTimeOffsetCore(object? obj, CultureInfo? culture, string? format, out DateTimeOffset? value)
1377if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1382else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1396/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1399public static bool TryConvertToDateOnly(object? obj, CultureInfo? culture, out DateOnly value)
1408/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1412public static bool TryConvertToDateOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, out DateOnly value)
1421/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1424public static bool TryConvertToNullableDateOnly(object? obj, CultureInfo? culture, out DateOnly? value)
1433/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1437public static bool TryConvertToNullableDateOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, out DateOnly? value)
1447private static bool ConvertToDateOnlyCore(object? obj, CultureInfo? culture, out DateOnly value)
1452private static bool ConvertToDateOnlyCore(object? obj, CultureInfo? culture, string? format, out DateOnly value)
1465private static bool ConvertToNullableDateOnlyCore(object? obj, CultureInfo? culture, out DateOnly? value)
1470private static bool ConvertToNullableDateOnlyCore(object? obj, CultureInfo? culture, string? format, out DateOnly? value)
1487/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1490public static bool TryConvertToTimeOnly(object? obj, CultureInfo? culture, out TimeOnly value)
1499/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1503public static bool TryConvertToTimeOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, out TimeOnly value)
1512/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1515public static bool TryConvertToNullableTimeOnly(object? obj, CultureInfo? culture, out TimeOnly? value)
1524/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1528public static bool TryConvertToNullableTimeOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, out TimeOnly? value)
1538private static bool ConvertToTimeOnlyCore(object? obj, CultureInfo? culture, out TimeOnly value)
1543private static bool ConvertToTimeOnlyCore(object? obj, CultureInfo? culture, string? format, out TimeOnly value)
1556private static bool ConvertToNullableTimeOnlyCore(object? obj, CultureInfo? culture, out TimeOnly? value)
1561private static bool ConvertToNullableTimeOnlyCore(object? obj, CultureInfo? culture, string? format, out TimeOnly? value)
1577private static bool ConvertToGuidCore(object? obj, CultureInfo? culture, out Guid value)
1584private static bool ConvertToNullableGuidCore(object? obj, CultureInfo? culture, out Guid? value)
1603private static bool ConvertToEnum<T>(object? obj, CultureInfo? _, out T value) where T : struct, Enum
1628private static bool ConvertToNullableEnum<T>(object? obj, CultureInfo? _, out T? value) where T : struct, Enum
1657/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1660public static bool TryConvertTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value)
1809string? FormatArrayValue(T[] value, CultureInfo? culture)
1847string? FormatWithTypeConverter(T value, CultureInfo? culture)
1850return typeConverter.ConvertToString(context: null, culture ?? CultureInfo.CurrentCulture, value);
2016bool ConvertToArray(object? obj, CultureInfo? culture, out T[]? value)
2054bool ConvertWithTypeConverter(object? obj, CultureInfo? culture, out T value)
2062var converted = typeConverter.ConvertFrom(context: null, culture ?? CultureInfo.CurrentCulture, obj);
Routing\UrlValueConstraint.cs (8)
42=> DateTime.TryParse(str, CultureInfo.InvariantCulture, DateTimeStyles.None, out result);
45=> DateOnly.TryParse(str, CultureInfo.InvariantCulture, DateTimeStyles.None, out result);
48=> TimeOnly.TryParse(str, CultureInfo.InvariantCulture, DateTimeStyles.None, out result);
51=> decimal.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out result);
54=> double.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out result);
57=> float.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out result);
60=> int.TryParse(str, NumberStyles.Integer, CultureInfo.InvariantCulture, out result);
63=> long.TryParse(str, NumberStyles.Integer, CultureInfo.InvariantCulture, out result);
Microsoft.AspNetCore.Components.Analyzers (2)
Microsoft.AspNetCore.Components.Analyzers.Tests (14)
Verifiers\DiagnosticVerifier.cs (13)
116string.Format(CultureInfo.InvariantCulture, "Mismatch between number of diagnostics returned, expected \"{0}\" actual \"{1}\"\r\n\r\nDiagnostics:\r\n{2}\r\n", expectedCount, actualCount, diagnosticsOutput));
129string.Format(CultureInfo.InvariantCulture, "Expected:\nA project diagnostic with No location\nActual:\n{0}",
142CultureInfo.InvariantCulture,
158CultureInfo.InvariantCulture,
167CultureInfo.InvariantCulture,
172if (actual.GetMessage(CultureInfo.InvariantCulture) != expected.Message)
176CultureInfo.InvariantCulture,
178expected.Message, actual.GetMessage(CultureInfo.InvariantCulture), FormatDiagnostics(analyzer, actual)));
196CultureInfo.InvariantCulture,
209CultureInfo.InvariantCulture,
222CultureInfo.InvariantCulture,
254builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id);
265CultureInfo.InvariantCulture,
Microsoft.AspNetCore.Components.Endpoints (15)
Builder\ResourceCollectionUrlEndpoint.cs (4)
34var fingerprintedResourceCollectionUrl = string.Format(CultureInfo.InvariantCulture, resourceCollectionUrlFormat, fingerprintSuffix, "");
36var fingerprintedGzResourceCollectionUrl = string.Format(CultureInfo.InvariantCulture, resourceCollectionUrlFormat, fingerprintSuffix, ".gz");
38var resourceCollectionUrl = string.Format(CultureInfo.InvariantCulture, resourceCollectionUrlFormat, "", "");
40var gzResourceCollectionUrl = string.Format(CultureInfo.InvariantCulture, resourceCollectionUrlFormat, "", ".gz");
Microsoft.AspNetCore.Components.Endpoints.Tests (102)
Binding\FormDataMapperTests.cs (80)
27var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
47var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
67var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
78private FormDataReader CreateFormDataReader(Dictionary<string, StringValues> collection, CultureInfo invariantCulture, IFormFileCollection formFileCollection = null)
86? new FormDataReader(dictionary, CultureInfo.InvariantCulture, new char[2048])
87: new FormDataReader(dictionary, CultureInfo.InvariantCulture, new char[2048], formFileCollection);
98var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
120var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
137var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
163var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
180var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
197var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
214var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
240var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
258var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
274var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
291var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
307var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
323var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
341var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
359var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
377var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
394Assert.Equal("The value 'a' is not valid for 'values'.", error.Message.ToString(CultureInfo.InvariantCulture));
402var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
421Assert.Equal("The value 'a' is not valid for 'values'.", error.Message.ToString(CultureInfo.InvariantCulture));
433$"[{i.ToString(CultureInfo.InvariantCulture)}]",
434(i + 10).ToString(CultureInfo.InvariantCulture))));
436var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
464$"[{i.ToString(CultureInfo.InvariantCulture)}]",
465(i + 10).ToString(CultureInfo.InvariantCulture))));
467var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
510$"[{i.ToString(CultureInfo.InvariantCulture)}]",
511(i + 10).ToString(CultureInfo.InvariantCulture))));
513var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
523var index = int.Parse(value, CultureInfo.InvariantCulture) - 10;
571$"[{i.ToString(CultureInfo.InvariantCulture)}]",
572(i + 10).ToString(CultureInfo.InvariantCulture))));
574var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
623var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
944var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
998var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1028var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1045var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1068$"[{i.ToString(CultureInfo.InvariantCulture)}]",
1069(i + 10).ToString(CultureInfo.InvariantCulture))));
1071var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1132var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1191var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1239var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1267var reader = CreateFormDataReader(collection, CultureInfo.InvariantCulture);
1297var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1323var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1371var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1430var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1458Assert.Equal("The maximum recursion depth of '5' was exceeded for 'Tail.Tail.Tail.Tail.Tail.Head'.", e.Message.ToString(CultureInfo.InvariantCulture));
1463Assert.Equal("The maximum recursion depth of '5' was exceeded for 'Tail.Tail.Tail.Tail.Tail.Tail'.", e.Message.ToString(CultureInfo.InvariantCulture));
1501var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1560var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1598var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1640var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1666var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1685var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1704var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1724var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1746var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1770var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1792var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1818var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1838var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1853var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1876var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
1893Assert.Equal("Missing required value for constructor parameter 'key'.", error.Message.ToString(CultureInfo.InvariantCulture));
1897Assert.Equal("Value cannot be null. (Parameter 'key')", constructorError.Message.ToString(CultureInfo.InvariantCulture));
1907var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture, formFileCollection);
1935var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture, formFileCollection);
1968var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture, formFileCollection);
1990var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture, expected);
2013var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture, expected);
2046var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture, expected);
2086var reader = CreateFormDataReader(data, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Components.Forms (2)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.QuickGrid.Tests (1)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (14)
Verifiers\DiagnosticVerifier.cs (13)
116string.Format(CultureInfo.InvariantCulture, "Mismatch between number of diagnostics returned, expected \"{0}\" actual \"{1}\"\r\n\r\nDiagnostics:\r\n{2}\r\n", expectedCount, actualCount, diagnosticsOutput));
129string.Format(CultureInfo.InvariantCulture, "Expected:\nA project diagnostic with No location\nActual:\n{0}",
142CultureInfo.InvariantCulture,
158CultureInfo.InvariantCulture,
167CultureInfo.InvariantCulture,
172if (actual.GetMessage(CultureInfo.InvariantCulture) != expected.Message)
176CultureInfo.InvariantCulture,
178expected.Message, actual.GetMessage(CultureInfo.InvariantCulture), FormatDiagnostics(analyzer, actual)));
196CultureInfo.InvariantCulture,
209CultureInfo.InvariantCulture,
222CultureInfo.InvariantCulture,
254builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id);
265CultureInfo.InvariantCulture,
Microsoft.AspNetCore.Components.Server (2)
Microsoft.AspNetCore.Components.Server.Tests (7)
Microsoft.AspNetCore.Components.Tests (42)
BindConverterTest.cs (16)
162var expected = value.ToString(CultureInfo.CurrentCulture);
176var expected = value.ToString("MM-yyyy", CultureInfo.InvariantCulture);
179var actual = BindConverter.FormatValue(value, "MM-yyyy", CultureInfo.InvariantCulture);
190var expected = value.ToString(CultureInfo.CurrentCulture);
204var expected = value.ToString("MM-yyyy", CultureInfo.InvariantCulture);
207var actual = BindConverter.FormatValue(value, "MM-yyyy", CultureInfo.InvariantCulture);
218var expected = value.ToString(CultureInfo.CurrentCulture);
232var expected = value.ToString("HH:mm", CultureInfo.InvariantCulture);
235var actual = BindConverter.FormatValue(value, "HH:mm", CultureInfo.InvariantCulture);
309var successfullyConverted = BindConverter.TryConvertTo<Guid>(incomingValue, CultureInfo.CurrentCulture, out var actual);
323var successfullyConverted = BindConverter.TryConvertTo<Guid>(incomingValue, CultureInfo.CurrentCulture, out var actual);
338var successfullyConverted = BindConverter.TryConvertTo<Guid?>(incomingValue, CultureInfo.CurrentCulture, out var actual);
351var successfullyConverted = BindConverter.TryConvertTo<Guid?>(incomingValue, CultureInfo.CurrentCulture, out var actual);
365var successfullyConverted = BindConverter.TryConvertTo<Guid?>(value, CultureInfo.CurrentCulture, out var actual);
400public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
420public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
EventCallbackFactoryBinderExtensionsTest.cs (10)
396await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), });
415await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), });
435await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format, CultureInfo.InvariantCulture), });
455await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format, CultureInfo.InvariantCulture), });
474await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), });
493await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), });
513await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format, CultureInfo.InvariantCulture), });
533await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format, CultureInfo.InvariantCulture), });
641var binder = EventCallback.Factory.CreateBinder(component, setter, value, CultureInfo.InvariantCulture);
699public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
Microsoft.AspNetCore.Components.Web (32)
Forms\InputDate.cs (6)
102DateTime dateTimeValue => BindConverter.FormatValue(dateTimeValue, _format, CultureInfo.InvariantCulture),
103DateTimeOffset dateTimeOffsetValue => BindConverter.FormatValue(dateTimeOffsetValue, _format, CultureInfo.InvariantCulture),
104DateOnly dateOnlyValue => BindConverter.FormatValue(dateOnlyValue, _format, CultureInfo.InvariantCulture),
105TimeOnly timeOnlyValue => BindConverter.FormatValue(timeOnlyValue, _format, CultureInfo.InvariantCulture),
112if (BindConverter.TryConvertTo(value, CultureInfo.InvariantCulture, out result))
120validationErrorMessage = string.Format(CultureInfo.InvariantCulture, _parsingErrorMessage, DisplayName ?? FieldIdentifier.FieldName);
Forms\InputNumber.cs (8)
70if (BindConverter.TryConvertTo<TValue>(value, CultureInfo.InvariantCulture, out result))
77validationErrorMessage = string.Format(CultureInfo.InvariantCulture, ParsingErrorMessage, DisplayName ?? FieldIdentifier.FieldName);
96return BindConverter.FormatValue(@int, CultureInfo.InvariantCulture);
99return BindConverter.FormatValue(@long, CultureInfo.InvariantCulture);
102return BindConverter.FormatValue(@short, CultureInfo.InvariantCulture);
105return BindConverter.FormatValue(@float, CultureInfo.InvariantCulture);
108return BindConverter.FormatValue(@double, CultureInfo.InvariantCulture);
111return BindConverter.FormatValue(@decimal, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Components.Web.Tests (3)
Microsoft.AspNetCore.Components.WebAssembly (17)
HotReload\WebAssemblyHotReload.cs (3)
112update.Deltas.Select(d => new UpdateDelta(Guid.Parse(d.ModuleId, CultureInfo.InvariantCulture), d.MetadataDelta, d.ILDelta, d.PdbDelta, d.UpdatedTypes)));
141[new UpdateDelta(Guid.Parse(moduleIdString, CultureInfo.InvariantCulture), metadataDelta, ilDelta, pdbBytes, updatedTypes ?? [])]);
153deltas.Select(d => new UpdateDelta(Guid.Parse(d.ModuleId, CultureInfo.InvariantCulture), d.MetadataDelta, d.ILDelta, d.PdbDelta, d.UpdatedTypes)));
Microsoft.AspNetCore.Components.WebAssembly.Tests (3)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
Microsoft.AspNetCore.CookiePolicy.Test (8)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (8)
75if (int.TryParse(value.AsSpan(ChunkCountPrefix.Length), NumberStyles.None, CultureInfo.InvariantCulture, out var chunksCount))
103var chunk = requestCookies[key + ChunkKeySuffix + chunkId.ToString(CultureInfo.InvariantCulture)];
115CultureInfo.CurrentCulture,
200keyValuePairs[0] = KeyValuePair.Create(key, ChunkCountPrefix + cookieChunkCount.ToString(CultureInfo.InvariantCulture));
209keyValuePairs[chunkId] = KeyValuePair.Create(string.Concat(key, ChunkKeySuffix, chunkId.ToString(CultureInfo.InvariantCulture)), segment);
243var subkey = key + ChunkKeySuffix + i.ToString(CultureInfo.InvariantCulture);
301keyValuePairs[i] = KeyValuePair.Create(string.Concat(key, "C", i.ToString(CultureInfo.InvariantCulture)), string.Empty);
319var subkey = key + ChunkKeySuffix + i.ToString(CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Cors (4)
Microsoft.AspNetCore.Cryptography.Internal (2)
Microsoft.AspNetCore.DataProtection (23)
Error.cs (6)
42var message = string.Format(CultureInfo.CurrentCulture, Resources.Common_PropertyCannotBeNullOrEmpty, propertyName);
48var message = string.Format(CultureInfo.CurrentCulture, Resources.Common_PropertyMustBeNonNegative, propertyName);
59var message = string.Format(CultureInfo.CurrentCulture, Resources.Common_KeyNotFound, id);
65var message = string.Format(CultureInfo.CurrentCulture, Resources.Common_KeyRevoked, id);
91var message = string.Format(CultureInfo.CurrentCulture, Resources.XmlKeyManager_DuplicateKey, keyId);
97var message = string.Format(CultureInfo.CurrentCulture, Resources.KeyRingProvider_DefaultKeyRevoked, id);
RegistryPolicyResolver.cs (11)
120options.EncryptionAlgorithm = Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!;
126options.EncryptionAlgorithmProvider = Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!;
132options.EncryptionAlgorithmKeySize = Convert.ToInt32(valueFromRegistry, CultureInfo.InvariantCulture);
138options.HashAlgorithm = Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!;
144options.HashAlgorithmProvider = Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture);
156options.EncryptionAlgorithm = Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!;
162options.EncryptionAlgorithmProvider = Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!;
168options.EncryptionAlgorithmKeySize = Convert.ToInt32(valueFromRegistry, CultureInfo.InvariantCulture);
180options.EncryptionAlgorithmType = ManagedAlgorithmHelpers.FriendlyNameToType(Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!);
186options.EncryptionAlgorithmKeySize = Convert.ToInt32(valueFromRegistry, CultureInfo.InvariantCulture);
192options.ValidationAlgorithmType = ManagedAlgorithmHelpers.FriendlyNameToType(Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!);
Microsoft.AspNetCore.DataProtection.Abstractions (7)
Microsoft.AspNetCore.DataProtection.Extensions (1)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (2)
Microsoft.AspNetCore.DataProtection.Tests (25)
KeyManagement\KeyRingProviderTests.cs (5)
917return DateTimeOffset.ParseExact(input, "u", CultureInfo.InvariantCulture).UtcDateTime;
924string.Format(CultureInfo.InvariantCulture, "{0:u}", now),
925string.Format(CultureInfo.InvariantCulture, "{0:u}", now.AddDays(90)));
931DateTimeOffset.ParseExact(activationDate, "u", CultureInfo.InvariantCulture),
932DateTimeOffset.ParseExact(expirationDate, "u", CultureInfo.InvariantCulture),
Microsoft.AspNetCore.DeveloperCertificates.XPlat (5)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
Microsoft.AspNetCore.Diagnostics (14)
StatusCodePage\StatusCodePagesExtensions.cs (5)
80var body = string.Format(CultureInfo.InvariantCulture, bodyFormat, context.HttpContext.Response.StatusCode);
103var location = string.Format(CultureInfo.InvariantCulture, locationFormat, context.HttpContext.Response.StatusCode);
112var location = string.Format(CultureInfo.InvariantCulture, locationFormat, context.HttpContext.Response.StatusCode);
216string.Format(CultureInfo.InvariantCulture, pathFormat, originalStatusCode));
218string.Format(CultureInfo.InvariantCulture, queryFormat, originalStatusCode);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (5)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (15)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (30)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (14)
78CultureInfo.InvariantCulture,
86int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
94int hours = int.Parse(offset.AsSpan(1, 2), CultureInfo.InvariantCulture);
95int minutes = int.Parse(offset.AsSpan(4, 2), CultureInfo.InvariantCulture);
147builder.Append(dateTime.ToString("yyyy'-'MM'-'dd'T'HH:mm:ss", CultureInfo.InvariantCulture));
155builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
159builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
163builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture));
196long seconds = long.Parse(secondsText, CultureInfo.InvariantCulture) * multiplier;
201int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
228builder.Append(seconds.ToString("d", CultureInfo.InvariantCulture));
258builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
262builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
266builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture));
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (10)
137return Convert.ToDouble(value, CultureInfo.InvariantCulture);
139return Convert.ToSingle(value, CultureInfo.InvariantCulture);
143return Convert.ToInt64(value, CultureInfo.InvariantCulture);
146return Convert.ToUInt64(value, CultureInfo.InvariantCulture);
150return Convert.ToInt32(value, CultureInfo.InvariantCulture);
152return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
165return Convert.ToUInt32(value, CultureInfo.InvariantCulture);
170var enumValueDescriptor = int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out var i)
623result += char.ToUpper(input[i], CultureInfo.InvariantCulture);
637result += char.ToLower(input[i], CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
Microsoft.AspNetCore.Grpc.Swagger (25)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (14)
78CultureInfo.InvariantCulture,
86int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
94int hours = int.Parse(offset.AsSpan(1, 2), CultureInfo.InvariantCulture);
95int minutes = int.Parse(offset.AsSpan(4, 2), CultureInfo.InvariantCulture);
147builder.Append(dateTime.ToString("yyyy'-'MM'-'dd'T'HH:mm:ss", CultureInfo.InvariantCulture));
155builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
159builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
163builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture));
196long seconds = long.Parse(secondsText, CultureInfo.InvariantCulture) * multiplier;
201int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
228builder.Append(seconds.ToString("d", CultureInfo.InvariantCulture));
258builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
262builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
266builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture));
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (10)
137return Convert.ToDouble(value, CultureInfo.InvariantCulture);
139return Convert.ToSingle(value, CultureInfo.InvariantCulture);
143return Convert.ToInt64(value, CultureInfo.InvariantCulture);
146return Convert.ToUInt64(value, CultureInfo.InvariantCulture);
150return Convert.ToInt32(value, CultureInfo.InvariantCulture);
152return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
165return Convert.ToUInt32(value, CultureInfo.InvariantCulture);
170var enumValueDescriptor = int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out var i)
623result += char.ToUpper(input[i], CultureInfo.InvariantCulture);
637result += char.ToLower(input[i], CultureInfo.InvariantCulture);
Microsoft.AspNetCore.HeaderParsing.Tests (17)
Microsoft.AspNetCore.HeaderPropagation (1)
Microsoft.AspNetCore.Hosting (16)
Microsoft.AspNetCore.Hosting.Abstractions (1)
Microsoft.AspNetCore.Hosting.FunctionalTests (1)
Microsoft.AspNetCore.Hosting.Tests (1)
Microsoft.AspNetCore.Html.Abstractions (1)
Microsoft.AspNetCore.Html.Abstractions.Tests (9)
Microsoft.AspNetCore.Http (3)
Microsoft.AspNetCore.Http.Abstractions (6)
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
Microsoft.AspNetCore.Http.Connections (7)
Microsoft.AspNetCore.Http.Connections.Tests (1)
Microsoft.AspNetCore.Http.Extensions (27)
RequestDelegateFactory.cs (13)
122private static readonly ConstructorInfo FormDataReaderConstructor = typeof(FormDataReader).GetConstructor(new[] { typeof(IReadOnlyDictionary<FormKey, StringValues>), typeof(CultureInfo), typeof(Memory<char>), typeof(IFormFileCollection) })!;
1761var tryParseCall = tryParseMethodCall(parsedValue, Expression.Constant(CultureInfo.InvariantCulture));
2152Expression.Constant(CultureInfo.InvariantCulture),
2661var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.InvalidJsonRequestBodyExceptionMessage, parameterTypeName, parameterName);
2675var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.ParameterBindingFailedExceptionMessage, parameterTypeName, parameterName, sourceValue);
2689var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.RequiredParameterNotProvidedExceptionMessage, parameterTypeName, parameterName, source);
2703var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.ImplicitBodyNotProvidedExceptionMessage, parameterName);
2717var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.UnexpectedJsonContentTypeExceptionMessage, contentType);
2731var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.UnexpectedFormContentTypeExceptionMessage, contentType);
2745var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.InvalidFormRequestBodyExceptionMessage, parameterTypeName, parameterName);
2759var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.InvalidAntiforgeryTokenExceptionMessage, parameterTypeName, parameterName);
2773var message = string.Format(CultureInfo.InvariantCulture, exception.Error.Message.Format, exception.Error.Message.GetArguments());
2787var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.UnexpectedRequestWithoutBodyExceptionMessage, parameterTypeName, parameterName);
src\Shared\ParameterBindingMethodCache.cs (8)
193stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"TryParse method found on {TypeNameHelper.GetTypeDisplayName(type, fullName: false)} with incorrect format. Must be a static method with format");
194stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"bool TryParse(string, IFormatProvider, out {TypeNameHelper.GetTypeDisplayName(type, fullName: false)})");
195stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"bool TryParse(string, out {TypeNameHelper.GetTypeDisplayName(type, fullName: false)})");
287stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"BindAsync method found on {TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)} with incorrect format. Must be a static method with format");
288stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}> BindAsync(HttpContext context, ParameterInfo parameter)");
289stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}> BindAsync(HttpContext context)");
290stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}?> BindAsync(HttpContext context, ParameterInfo parameter)");
291stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}?> BindAsync(HttpContext context)");
Microsoft.AspNetCore.Http.Extensions.Tests (29)
ParameterBindingMethodCacheTests.cs (8)
33var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression;
73var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression;
105var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression;
113Assert.True(((call.Arguments[1] as ConstantExpression)!.Value as CultureInfo)!.Equals(CultureInfo.InvariantCulture));
129var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression;
183var call = methodFound!(Expression.Variable(type, "parsedValue"), Expression.Constant(CultureInfo.InvariantCulture)) as MethodCallExpression;
205var block = methodFound!(parsedValue, Expression.Constant(CultureInfo.InvariantCulture)) as BlockExpression;
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (7)
Microsoft.AspNetCore.Http.Tests (2)
Microsoft.AspNetCore.HttpLogging (7)
W3CLoggingMiddleware.cs (4)
84shouldLog |= AddToList(elements, _dateIndex, now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
89shouldLog |= AddToList(elements, _timeIndex, now.ToString("HH:mm:ss", CultureInfo.InvariantCulture));
114shouldLog |= AddToList(elements, _serverPortIndex, connectionInfo.LocalPort.ToString(CultureInfo.InvariantCulture));
219shouldLog |= AddToList(elements, _timeTakenIndex, stopWatch.GetElapsedTime().TotalMilliseconds.ToString(CultureInfo.InvariantCulture));
Microsoft.AspNetCore.HttpLogging.Tests (9)
Microsoft.AspNetCore.HttpOverrides.Tests (1)
Microsoft.AspNetCore.HttpsPolicy (2)
Microsoft.AspNetCore.Identity (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (2)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (7)
Microsoft.AspNetCore.Identity.FunctionalTests (7)
MapIdentityApiTests.cs (6)
700var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
741var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
793var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
809var resetTwoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
840var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
909var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Identity.InMemory.Test (3)
Microsoft.AspNetCore.Identity.Test (1)
Microsoft.AspNetCore.Identity.UI (2)
Microsoft.AspNetCore.InternalTesting (44)
Microsoft.AspNetCore.InternalTesting.Tests (18)
EnvironmentVariableSkipConditionTest.cs (2)
51string.Format(CultureInfo.InvariantCulture, _skipReason, "Run", environmentVariableValue, attribute.RunOnMatch),
70string.Format(CultureInfo.InvariantCulture, _skipReason, "Run", "(null)", attribute.RunOnMatch),
Microsoft.AspNetCore.JsonPatch (16)
JsonPatchDocumentOfT.cs (15)
83GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
138GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
197GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
259GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
327GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
350GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
376GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
377GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
401GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
469GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
492GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
518GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
519GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
543GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
736return Convert.ToString(func(null), CultureInfo.InvariantCulture);
Microsoft.AspNetCore.JsonPatch.SystemTextJson (16)
JsonPatchDocumentOfT.cs (15)
84GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
139GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
198GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
260GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
328GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
351GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
377GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
378GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
402GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
470GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
493GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
519GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
520GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
544GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
739return Convert.ToString(func(null), CultureInfo.InvariantCulture);
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (3)
Microsoft.AspNetCore.JsonPatch.Tests (3)
Microsoft.AspNetCore.Localization (47)
Microsoft.AspNetCore.Localization.Routing.Tests (4)
Microsoft.AspNetCore.Localization.Tests (49)
Microsoft.AspNetCore.Mvc.Abstractions (16)
src\Shared\ParameterBindingMethodCache.cs (8)
193stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"TryParse method found on {TypeNameHelper.GetTypeDisplayName(type, fullName: false)} with incorrect format. Must be a static method with format");
194stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"bool TryParse(string, IFormatProvider, out {TypeNameHelper.GetTypeDisplayName(type, fullName: false)})");
195stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"bool TryParse(string, out {TypeNameHelper.GetTypeDisplayName(type, fullName: false)})");
287stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"BindAsync method found on {TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)} with incorrect format. Must be a static method with format");
288stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}> BindAsync(HttpContext context, ParameterInfo parameter)");
289stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}> BindAsync(HttpContext context)");
290stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}?> BindAsync(HttpContext context, ParameterInfo parameter)");
291stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}?> BindAsync(HttpContext context)");
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core (61)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (8)
75if (int.TryParse(value.AsSpan(ChunkCountPrefix.Length), NumberStyles.None, CultureInfo.InvariantCulture, out var chunksCount))
103var chunk = requestCookies[key + ChunkKeySuffix + chunkId.ToString(CultureInfo.InvariantCulture)];
115CultureInfo.CurrentCulture,
200keyValuePairs[0] = KeyValuePair.Create(key, ChunkCountPrefix + cookieChunkCount.ToString(CultureInfo.InvariantCulture));
209keyValuePairs[chunkId] = KeyValuePair.Create(string.Concat(key, ChunkKeySuffix, chunkId.ToString(CultureInfo.InvariantCulture)), segment);
243var subkey = key + ChunkKeySuffix + i.ToString(CultureInfo.InvariantCulture);
301keyValuePairs[i] = KeyValuePair.Create(string.Concat(key, "C", i.ToString(CultureInfo.InvariantCulture)), string.Empty);
319var subkey = key + ChunkKeySuffix + i.ToString(CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Mvc.Core.Test (58)
Microsoft.AspNetCore.Mvc.Core.TestCommon (3)
Microsoft.AspNetCore.Mvc.Cors (1)
Microsoft.AspNetCore.Mvc.Cors.Test (1)
Microsoft.AspNetCore.Mvc.DataAnnotations (8)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (10)
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (8)
Microsoft.AspNetCore.Mvc.FunctionalTests (45)
AntiforgeryMiddlewareTest.cs (5)
47new("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.CurrentCulture)),
88new("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.CurrentCulture)),
131new("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.CurrentCulture)),
163new("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.CurrentCulture)),
195new("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.CurrentCulture)),
Microsoft.AspNetCore.Mvc.IntegrationTests (10)
Microsoft.AspNetCore.Mvc.Localization.Test (5)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (4)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (10)
Microsoft.AspNetCore.Mvc.Razor (6)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (6)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (4)
Microsoft.AspNetCore.Mvc.RazorPages (5)
Microsoft.AspNetCore.Mvc.TagHelpers (9)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
Microsoft.AspNetCore.Mvc.Testing (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (42)
DefaultHtmlGenerator.cs (14)
116return ViewDataDictionary.FormatValue(value, format, CultureInfo.CurrentCulture);
444var valueString = Convert.ToString(value, CultureInfo.CurrentCulture);
460var valueString = Convert.ToString(value, CultureInfo.CurrentCulture);
649tagBuilder.MergeAttribute("rows", rows.ToString(CultureInfo.InvariantCulture), replaceExisting: true);
656columns.ToString(CultureInfo.InvariantCulture),
975var stringValue = (value as string) ?? Convert.ToString(value, CultureInfo.CurrentCulture);
1030return Convert.ToString(viewContext.ViewData.Eval(key, format), CultureInfo.CurrentCulture);
1184CultureInfo culture;
1187culture = CultureInfo.InvariantCulture;
1192culture = CultureInfo.CurrentCulture;
1353tagBuilder.MergeAttribute("maxlength", maxLengthValue.Value.ToString(CultureInfo.InvariantCulture));
1410return Convert.ToBoolean(viewContext.ViewData.Eval(key), CultureInfo.InvariantCulture);
1415return Convert.ToString(viewContext.ViewData.Eval(key), CultureInfo.CurrentCulture);
1537var attributeString = Convert.ToString(attributeObject, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (33)
DefaultHtmlGeneratorTest.cs (5)
211Assert.Equal(expectedValue, int.Parse(attribute.Value, CultureInfo.InvariantCulture));
235Assert.Equal(expectedValue, int.Parse(attribute.Value, CultureInfo.InvariantCulture));
259Assert.Equal(expectedValue, int.Parse(attribute.Value, CultureInfo.InvariantCulture));
281Assert.Equal(Math.Min(ModelWithMaxLengthMetadata.MaxLengthAttributeValue, ModelWithMaxLengthMetadata.StringLengthAttributeValue), int.Parse(attribute.Value, CultureInfo.InvariantCulture));
327Assert.Equal(expectedValue, int.Parse(attribute.Value, CultureInfo.InvariantCulture));
Rendering\HtmlHelperLinkGenerationTest.cs (6)
49CultureInfo.InvariantCulture,
64CultureInfo.InvariantCulture,
120CultureInfo.InvariantCulture,
134CultureInfo.InvariantCulture,
160return string.Join(string.Empty, dict.Select(kvp => string.Format(CultureInfo.InvariantCulture, "{0}={1}", kvp.Key, kvp.Value.ToString())));
166return string.Join(string.Empty, dict.Select(kvp => string.Format(CultureInfo.InvariantCulture, " {0}=\"HtmlEncode[[{1}]]\"", kvp.Key, kvp.Value.ToString())));
Microsoft.AspNetCore.OpenApi (15)
src\Shared\ParameterBindingMethodCache.cs (8)
193stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"TryParse method found on {TypeNameHelper.GetTypeDisplayName(type, fullName: false)} with incorrect format. Must be a static method with format");
194stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"bool TryParse(string, IFormatProvider, out {TypeNameHelper.GetTypeDisplayName(type, fullName: false)})");
195stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"bool TryParse(string, out {TypeNameHelper.GetTypeDisplayName(type, fullName: false)})");
287stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"BindAsync method found on {TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)} with incorrect format. Must be a static method with format");
288stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}> BindAsync(HttpContext context, ParameterInfo parameter)");
289stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}> BindAsync(HttpContext context)");
290stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}?> BindAsync(HttpContext context, ParameterInfo parameter)");
291stringBuilder.AppendLine(CultureInfo.InvariantCulture, $"ValueTask<{TypeNameHelper.GetTypeDisplayName(nonNullableParameterType, fullName: false)}?> BindAsync(HttpContext context)");
Microsoft.AspNetCore.OpenApi.SourceGenerators (3)
Microsoft.AspNetCore.OpenApi.Tests (15)
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (6)
148Assert.Equal(minimum?.ToString(CultureInfo.InvariantCulture), parameter.Schema.Minimum);
149Assert.Equal(maximum?.ToString(CultureInfo.InvariantCulture), parameter.Schema.Maximum);
373[([Range(int.MinValue, int.MaxValue)] int id) => {}, (OpenApiSchema schema) => { Assert.Equal(int.MinValue.ToString(CultureInfo.InvariantCulture), schema.Minimum); Assert.Equal(int.MaxValue.ToString(CultureInfo.InvariantCulture), schema.Maximum); }],
376[([Range(typeof(long), "-9223372036854775808", "9223372036854775807")] long id) => {}, (OpenApiSchema schema) => { Assert.Equal(long.MinValue.ToString(CultureInfo.InvariantCulture), schema.Minimum); Assert.Equal(long.MaxValue.ToString(CultureInfo.InvariantCulture), schema.Maximum); }],
Microsoft.AspNetCore.OutputCaching (2)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.OutputCaching.Tests (2)
Microsoft.AspNetCore.Owin (20)
OwinEnvironment.cs (16)
87.Concat(_context.Items.Keys.Select(key => Convert.ToString(key, CultureInfo.InvariantCulture)))
221yield return new KeyValuePair<string, object>(Convert.ToString(entryPair.Key, CultureInfo.InvariantCulture), entryPair.Value);
409{ OwinConstants.RequestProtocol, new FeatureMap<IHttpRequestFeature>(feature => feature.Protocol, () => string.Empty, (feature, value) => feature.Protocol = Convert.ToString(value, CultureInfo.InvariantCulture)) },
410{ OwinConstants.RequestScheme, new FeatureMap<IHttpRequestFeature>(feature => feature.Scheme, () => string.Empty, (feature, value) => feature.Scheme = Convert.ToString(value, CultureInfo.InvariantCulture)) },
411{ OwinConstants.RequestMethod, new FeatureMap<IHttpRequestFeature>(feature => feature.Method, () => string.Empty, (feature, value) => feature.Method = Convert.ToString(value, CultureInfo.InvariantCulture)) },
412{ OwinConstants.RequestPathBase, new FeatureMap<IHttpRequestFeature>(feature => feature.PathBase, () => string.Empty, (feature, value) => feature.PathBase = Convert.ToString(value, CultureInfo.InvariantCulture)) },
413{ OwinConstants.RequestPath, new FeatureMap<IHttpRequestFeature>(feature => feature.Path, () => string.Empty, (feature, value) => feature.Path = Convert.ToString(value, CultureInfo.InvariantCulture)) },
414{ OwinConstants.RequestQueryString, new FeatureMap<IHttpRequestFeature>(feature => Utilities.RemoveQuestionMark(feature.QueryString), () => string.Empty, (feature, value) => feature.QueryString = Utilities.AddQuestionMark(Convert.ToString(value, CultureInfo.InvariantCulture))) },
419{ OwinConstants.ResponseStatusCode, new FeatureMap<IHttpResponseFeature>(feature => feature.StatusCode, () => 200, (feature, value) => feature.StatusCode = Convert.ToInt32(value, CultureInfo.InvariantCulture)) },
420{ OwinConstants.ResponseReasonPhrase, new FeatureMap<IHttpResponseFeature>(feature => feature.ReasonPhrase, (feature, value) => feature.ReasonPhrase = Convert.ToString(value, CultureInfo.InvariantCulture)) },
432{ OwinConstants.CommonKeys.ConnectionId, new FeatureMap<IHttpConnectionFeature>(feature => feature.ConnectionId, (feature, value) => feature.ConnectionId = Convert.ToString(value, CultureInfo.InvariantCulture)) },
434{ OwinConstants.CommonKeys.LocalPort, new FeatureMap<IHttpConnectionFeature>(feature => PortToString(feature.LocalPort), (feature, value) => feature.LocalPort = Convert.ToInt32(value, CultureInfo.InvariantCulture)) },
435{ OwinConstants.CommonKeys.RemotePort, new FeatureMap<IHttpConnectionFeature>(feature => PortToString(feature.RemotePort), (feature, value) => feature.RemotePort = Convert.ToInt32(value, CultureInfo.InvariantCulture)) },
437{ OwinConstants.CommonKeys.LocalIpAddress, new FeatureMap<IHttpConnectionFeature>(feature => feature.LocalIpAddress.ToString(), (feature, value) => feature.LocalIpAddress = IPAddress.Parse(Convert.ToString(value, CultureInfo.InvariantCulture))) },
438{ OwinConstants.CommonKeys.RemoteIpAddress, new FeatureMap<IHttpConnectionFeature>(feature => feature.RemoteIpAddress.ToString(), (feature, value) => feature.RemoteIpAddress = IPAddress.Parse(Convert.ToString(value, CultureInfo.InvariantCulture))) },
491_ => port.ToString(CultureInfo.InvariantCulture),
Microsoft.AspNetCore.RateLimiting (1)
Microsoft.AspNetCore.Razor.Runtime (1)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Microsoft.AspNetCore.Razor.Test (5)
TagHelpers\DefaultTagHelperContentTest.cs (5)
238tagHelperContent.AppendFormat(CultureInfo.InvariantCulture, "{0} {1} {2} {3}!", "First", "Second", "Third", "Fourth");
254CultureInfo.InvariantCulture,
278tagHelperContent.AppendFormat(CultureInfo.InvariantCulture, "Content was {0}", helloWorldContent);
704tagHelperContent.SetContent("First ").AppendFormat(CultureInfo.InvariantCulture, "{0} Third", "Second");
720.AppendFormat(CultureInfo.InvariantCulture, "{0} Third ", "Second")
Microsoft.AspNetCore.ResponseCaching.Tests (2)
Microsoft.AspNetCore.Rewrite (21)
Microsoft.AspNetCore.Rewrite.Tests (1)
Microsoft.AspNetCore.Routing (38)
Microsoft.AspNetCore.Routing.FunctionalTests (19)
MinimalFormTests.cs (19)
60new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
92DueDate = DateTime.Parse(form["dueDate"], CultureInfo.InvariantCulture)
120new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
165new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
204new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
281new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
328new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
354DueDate = DateTime.Parse(form["dueDate"], CultureInfo.InvariantCulture)
368DueDate = DateTime.Parse(form["dueDate"], CultureInfo.InvariantCulture)
382DueDate = DateTime.Parse(form["dueDate"], CultureInfo.InvariantCulture)
424new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
481new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
542new KeyValuePair<string,string>("[dueDate]", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
543new KeyValuePair<string,string>("[dueDate1]", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
594new KeyValuePair<string,string>("[dueDate]", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
595new KeyValuePair<string,string>("[dueDate1]", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
646new KeyValuePair<string,string>("[dueDate]", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
647new KeyValuePair<string,string>("[dueDate1]", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
693new KeyValuePair<string,string>("dueDate", DateTime.Today.AddDays(1).ToString(CultureInfo.InvariantCulture)),
Microsoft.AspNetCore.Routing.Tests (2)
Microsoft.AspNetCore.Server.HttpSys (14)
UrlPrefix.cs (6)
20HostAndPort = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", Host, Port);
24FullPrefix = string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}{3}", Scheme, Host, Port, Path);
39portValue = int.Parse(port, NumberStyles.None, CultureInfo.InvariantCulture);
80port = portValue.Value.ToString(CultureInfo.InvariantCulture);
132if (int.TryParse(portValueString, NumberStyles.Integer, CultureInfo.InvariantCulture, out portValue))
194return string.Equals(FullPrefix, Convert.ToString(obj, CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (41)
RequestTests.cs (6)
273Assert.Equal(StatusCodes.Status200OK.ToString(CultureInfo.InvariantCulture), responseStatusCode);
290Assert.Equal(StatusCodes.Status400BadRequest.ToString(CultureInfo.InvariantCulture), responseStatusCode);
345stringBuilder.Append(i.ToString("X2", CultureInfo.InvariantCulture));
482Assert.True(string.Equals("400", responseStatusCode), i.ToString("X2", CultureInfo.InvariantCulture));
498var response = await SendSocketRequestAsync(root, "/%" + i.ToString("X2", CultureInfo.InvariantCulture));
500Assert.True(string.Equals("400", responseStatusCode), i.ToString("X2", CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Server.IIS (6)
Microsoft.AspNetCore.Server.IISIntegration (1)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (4)
Microsoft.AspNetCore.Server.Kestrel.Core (27)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (20)
src\Servers\Kestrel\shared\KnownHeaders.cs (10)
479public string FlagBit() => $"{"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L";
480public string TestBitCore(string name) => $"({name} & {"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L) != 0";
483public string TestNotTempBit() => $"(tempBits & ~{"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L) == 0";
484public string TestNotBit() => $"(_bits & {"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L) == 0";
485public string SetBit() => $"_bits |= {"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L";
486public string ClearBit() => $"_bits &= ~{"0x" + (1L << Index).ToString("x", CultureInfo.InvariantCulture)}L";
1160tempBits &= ~{"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
1176tempBits &= ~{"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
1249tempBits ^= {"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
1401")}_currentBits ^= {"0x" + (1L << header.Index).ToString("x", CultureInfo.InvariantCulture)}L;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.Session (1)
Microsoft.AspNetCore.Session.Tests (5)
Microsoft.AspNetCore.Shared.Tests (28)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Client.Tests (9)
Microsoft.AspNetCore.SignalR.Common.Tests (3)
Internal\Protocol\JsonHubProtocolTestsBase.cs (3)
38new JsonProtocolTestData("InvocationMessage_DateTimeOffsetArgument", new InvocationMessage("Method", new object[] { DateTimeOffset.Parse("2016-05-10T13:51:20+12:34", CultureInfo.InvariantCulture) }), true, true, "{\"type\":1,\"target\":\"Method\",\"arguments\":[\"2016-05-10T13:51:20+12:34\"]}"),
103new JsonProtocolTestData("InvocationMessage_DateTimeOffsetArgumentFirst", new InvocationMessage("Method", new object[] { DateTimeOffset.Parse("2016-05-10T13:51:20+12:34", CultureInfo.InvariantCulture) }), false, true, "{ \"arguments\": [\"2016-05-10T13:51:20+12:34\"], \"type\":1, \"target\": \"Method\" }"),
329DateTimeProp = DateTime.Parse("6/3/2019 10:00:00 PM", CultureInfo.InvariantCulture)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (6)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (6)
Microsoft.AspNetCore.StaticAssets.Tests (7)
StaticAssetsIntegrationTests.cs (7)
504new("Content-Length", resource.Content.Length.ToString(CultureInfo.InvariantCulture)),
507new("Last-Modified", lastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)),
527new ("Content-Length", length.ToString(CultureInfo.InvariantCulture)),
530new ("Last-Modified", lastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)),
583new("Content-Length", "Hello, World!".Length.ToString(CultureInfo.InvariantCulture)),
586new("Last-Modified", new DateTimeOffset(2023,03,03,0,0,0,TimeSpan.Zero).ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture))
928req2.Headers.TryAddWithoutValidation("If-Modified-Since", DateTimeOffset.UtcNow.ToString(format, CultureInfo.InvariantCulture));
Microsoft.AspNetCore.StaticFiles (12)
HtmlDirectoryFormatter.cs (11)
53CultureInfo.InvariantCulture,
55<html lang=""{0}"">", CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
58CultureInfo.InvariantCulture,
101CultureInfo.InvariantCulture,
110CultureInfo.InvariantCulture,
116CultureInfo.InvariantCulture,
137CultureInfo.InvariantCulture,
145HtmlEncode(subdir.LastModified.ToString(CultureInfo.CurrentCulture)));
173CultureInfo.InvariantCulture,
181HtmlEncode(file.Length.ToString("n0", CultureInfo.CurrentCulture)),
182HtmlEncode(file.LastModified.ToString(CultureInfo.CurrentCulture)));
Microsoft.AspNetCore.StaticFiles.Tests (2)
Microsoft.AspNetCore.WebSockets (3)
Microsoft.AspNetCore.WebUtilities (10)
Microsoft.AspNetCore.WebUtilities.Tests (1)
Microsoft.Build.Framework (37)
Microsoft.Build.Tasks.CodeAnalysis (12)
src\Compilers\Core\MSBuildTask\Csc.cs (3)
662if (!string.IsNullOrEmpty(PreferredUILang) && !string.Equals(PreferredUILang, System.Globalization.CultureInfo.CurrentUICulture.Name, StringComparison.OrdinalIgnoreCase))
691Log.LogError(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
695Log.LogWarning(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (12)
src\Compilers\Core\MSBuildTask\Csc.cs (3)
662if (!string.IsNullOrEmpty(PreferredUILang) && !string.Equals(PreferredUILang, System.Globalization.CultureInfo.CurrentUICulture.Name, StringComparison.OrdinalIgnoreCase))
691Log.LogError(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
695Log.LogWarning(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
Microsoft.Cci.Extensions (2)
Microsoft.CodeAnalysis (83)
CommandLine\ReportAnalyzerUtil.cs (6)
22CultureInfo culture,
42public static string GetFormattedAnalyzerExecutionTime(double executionTime, CultureInfo culture) =>
47public static string GetFormattedAnalyzerExecutionPercentage(int percentage, CultureInfo culture) =>
57private static string GetColumnEntry(double totalSeconds, int percentage, string? name, CultureInfo culture)
65private static void ReportAnalyzerExecutionTime(TextWriter consoleOutput, AnalyzerDriver analyzerDriver, CultureInfo culture)
112private static void ReportGeneratorExecutionTime(TextWriter consoleOutput, GeneratorDriverTimingInfo driverTimingInfo, CultureInfo culture)
Microsoft.CodeAnalysis.Analyzers (10)
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (5)
Microsoft.CodeAnalysis.CodeStyle (6)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (84)
SymbolDisplay\ObjectDisplay.cs (14)
358internal static string FormatLiteral(sbyte value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
372internal static string FormatLiteral(byte value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
384internal static string FormatLiteral(short value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
398internal static string FormatLiteral(ushort value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
410internal static string FormatLiteral(int value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
422internal static string FormatLiteral(uint value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
445internal static string FormatLiteral(long value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
468internal static string FormatLiteral(ulong value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
491internal static string FormatLiteral(double value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
498internal static string FormatLiteral(float value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
505internal static string FormatLiteral(decimal value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
512private static CultureInfo GetFormatCulture(CultureInfo cultureInfo)
514return cultureInfo ?? CultureInfo.InvariantCulture;
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (214)
CommandLineTests.cs (180)
149var outWriter = new StringWriter(CultureInfo.InvariantCulture);
169var outWriter = new StringWriter(CultureInfo.InvariantCulture);
205var outWriter = new StringWriter(CultureInfo.InvariantCulture);
247var outWriter = new StringWriter(CultureInfo.InvariantCulture);
300var outWriter = new StringWriter(CultureInfo.InvariantCulture);
350var outWriter = new StringWriter(CultureInfo.InvariantCulture);
386var outWriter = new StringWriter(CultureInfo.InvariantCulture);
405var outWriter = new StringWriter(CultureInfo.InvariantCulture);
425var outWriter = new StringWriter(CultureInfo.InvariantCulture);
583var outWriter = new StringWriter(CultureInfo.InvariantCulture);
691var outWriter = new StringWriter(CultureInfo.InvariantCulture);
696outWriter = new StringWriter(CultureInfo.InvariantCulture);
701outWriter = new StringWriter(CultureInfo.InvariantCulture);
706outWriter = new StringWriter(CultureInfo.InvariantCulture);
1853var originalCulture = Thread.CurrentThread.CurrentCulture;
1864var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2238var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2270var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2299var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2442var output = new StringWriter(CultureInfo.InvariantCulture);
2773var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2796var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2912var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2948var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2981var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2993outWriter = new StringWriter(CultureInfo.InvariantCulture);
3500var outWriter = new StringWriter(CultureInfo.InvariantCulture);
3512outWriter = new StringWriter(CultureInfo.InvariantCulture);
3570var outWriter = new StringWriter(CultureInfo.InvariantCulture);
3598outWriter = new StringWriter(CultureInfo.InvariantCulture);
4335var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4356var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4479var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4739var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4744outWriter = new StringWriter(CultureInfo.InvariantCulture);
4762var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4784var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5898var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5903outWriter = new StringWriter(CultureInfo.InvariantCulture);
5910outWriter = new StringWriter(CultureInfo.InvariantCulture);
5915outWriter = new StringWriter(CultureInfo.InvariantCulture);
5935var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5940outWriter = new StringWriter(CultureInfo.InvariantCulture);
5955var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5960outWriter = new StringWriter(CultureInfo.InvariantCulture);
6332var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6422var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6521var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6563var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6604var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6940var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6962var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6986var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7009var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7067var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7111var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7187var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7210var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7236var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7264var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7292var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7318var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7812int actualExitCode = csc.Run(new StringWriter(CultureInfo.InvariantCulture));
7856var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7863outWriter = new StringWriter(CultureInfo.InvariantCulture);
7870outWriter = new StringWriter(CultureInfo.InvariantCulture);
7877outWriter = new StringWriter(CultureInfo.InvariantCulture);
7903var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7911outWriter = new StringWriter(CultureInfo.InvariantCulture);
7937var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7945outWriter = new StringWriter(CultureInfo.InvariantCulture);
7971var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7979outWriter = new StringWriter(CultureInfo.InvariantCulture);
7996var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8001outWriter = new StringWriter(CultureInfo.InvariantCulture);
8009outWriter = new StringWriter(CultureInfo.InvariantCulture);
8150var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8155outWriter = new StringWriter(CultureInfo.InvariantCulture);
8163outWriter = new StringWriter(CultureInfo.InvariantCulture);
8179var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8184outWriter = new StringWriter(CultureInfo.InvariantCulture);
8189outWriter = new StringWriter(CultureInfo.InvariantCulture);
8194outWriter = new StringWriter(CultureInfo.InvariantCulture);
8199outWriter = new StringWriter(CultureInfo.InvariantCulture);
8204outWriter = new StringWriter(CultureInfo.InvariantCulture);
8209outWriter = new StringWriter(CultureInfo.InvariantCulture);
8216outWriter = new StringWriter(CultureInfo.InvariantCulture);
8222outWriter = new StringWriter(CultureInfo.InvariantCulture);
8391var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8400outWriter = new StringWriter(CultureInfo.InvariantCulture);
8410outWriter = new StringWriter(CultureInfo.InvariantCulture);
8419outWriter = new StringWriter(CultureInfo.InvariantCulture);
8428outWriter = new StringWriter(CultureInfo.InvariantCulture);
8437outWriter = new StringWriter(CultureInfo.InvariantCulture);
8525var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8530outWriter = new StringWriter(CultureInfo.InvariantCulture);
8535outWriter = new StringWriter(CultureInfo.InvariantCulture);
8564var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8588var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8622var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8642var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8667var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8694var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8713var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8751var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8830var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8937var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8956var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8993var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9016var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9038var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9068var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9089var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9115var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9142var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9207var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9234var writer = new StringWriter(CultureInfo.InvariantCulture);
9365var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9429var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9520var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9562var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9580var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9605var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9627var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9637Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.MessageFormat.ToString(CultureInfo.InvariantCulture), output, StringComparison.Ordinal);
9678var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9683outWriter = new StringWriter(CultureInfo.InvariantCulture);
9688outWriter = new StringWriter(CultureInfo.InvariantCulture);
9693outWriter = new StringWriter(CultureInfo.InvariantCulture);
9698outWriter = new StringWriter(CultureInfo.InvariantCulture);
9703outWriter = new StringWriter(CultureInfo.InvariantCulture);
9708outWriter = new StringWriter(CultureInfo.InvariantCulture);
9718var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9734var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9827var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9833outWriter = new StringWriter(CultureInfo.InvariantCulture);
9839outWriter = new StringWriter(CultureInfo.InvariantCulture);
10028var outWriter = new StringWriter(CultureInfo.InvariantCulture);
10070var outWriter = new StringWriter(CultureInfo.InvariantCulture);
10578var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11196var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11208var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11220var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11232var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11613var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11792var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11857var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11908var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12285var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12500var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12520var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12567new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.None).GetMessage(CultureInfo.InvariantCulture),
12607new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_EmptySwitch), Location.None).GetMessage(CultureInfo.InvariantCulture),
12663new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_UnreferencedField, "C.f"), Location.None).GetMessage(CultureInfo.InvariantCulture),
12731new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_PrecedenceInversion, "from"), Location.None).GetMessage(CultureInfo.InvariantCulture),
12831new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_SequentialOnPartialClass, "MyPartialStruct"), Location.None).GetMessage(CultureInfo.InvariantCulture),
12941new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_SequentialOnPartialClass, "MyPartialStruct"), Location.None).GetMessage(CultureInfo.InvariantCulture),
13421var outWriter = new StringWriter(CultureInfo.InvariantCulture);
13666var outWriter = new StringWriter(CultureInfo.InvariantCulture);
13753var outWriter = new StringWriter(CultureInfo.InvariantCulture);
13790var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14716var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14778var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14798var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14823var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14843var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14917var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14955var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15037var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15558var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15572outWriter = new StringWriter(CultureInfo.InvariantCulture);
15610var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15622outWriter = new StringWriter(CultureInfo.InvariantCulture);
15692var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15706outWriter = new StringWriter(CultureInfo.InvariantCulture);
15745var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15757outWriter = new StringWriter(CultureInfo.InvariantCulture);
15824var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15863var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15903var outWriter = new StringWriter(CultureInfo.InvariantCulture);
SarifV2ErrorLoggerTests.cs (11)
304AnalyzerForErrorLogTest.GetExpectedV2ErrorLogRulesText(cmd.DescriptorsWithInfo, CultureInfo.InvariantCulture));
338AnalyzerForErrorLogTest.GetExpectedV2ErrorLogRulesText(cmd.DescriptorsWithInfo, CultureInfo.InvariantCulture, suppressionKinds1: suppressionKinds));
375AnalyzerForErrorLogTest.GetExpectedV2ErrorLogRulesText(cmd.DescriptorsWithInfo, CultureInfo.InvariantCulture),
435return string.Format(CultureInfo.InvariantCulture, s, arguments);
453var outWriter = new StringWriter(CultureInfo.InvariantCulture);
495AnalyzerForErrorLogTest.GetExpectedV2ErrorLogRulesText(cmd.DescriptorsWithInfo, CultureInfo.InvariantCulture,
535var outWriter = new StringWriter(CultureInfo.InvariantCulture);
577AnalyzerForErrorLogTest.GetExpectedV2ErrorLogRulesText(cmd.DescriptorsWithInfo, CultureInfo.InvariantCulture,
605var outWriter = new StringWriter(CultureInfo.InvariantCulture);
648AnalyzerForErrorLogTest.GetExpectedV2ErrorLogRulesText(cmd.DescriptorsWithInfo, CultureInfo.InvariantCulture, suppressionKinds1: new[] { "inSource" }));
684var outWriter = new StringWriter(CultureInfo.InvariantCulture);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (15)
src\Compilers\CSharp\Portable\SymbolDisplay\ObjectDisplay.cs (14)
358internal static string FormatLiteral(sbyte value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
372internal static string FormatLiteral(byte value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
384internal static string FormatLiteral(short value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
398internal static string FormatLiteral(ushort value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
410internal static string FormatLiteral(int value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
422internal static string FormatLiteral(uint value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
445internal static string FormatLiteral(long value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
468internal static string FormatLiteral(ulong value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
491internal static string FormatLiteral(double value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
498internal static string FormatLiteral(float value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
505internal static string FormatLiteral(decimal value, ObjectDisplayOptions options, CultureInfo cultureInfo = null)
512private static CultureInfo GetFormatCulture(CultureInfo cultureInfo)
514return cultureInfo ?? CultureInfo.InvariantCulture;
Microsoft.CodeAnalysis.CSharp.Features (9)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting (13)
Hosting\ObjectFormatter\CSharpPrimitiveFormatter.cs (12)
36protected override string FormatLiteral(sbyte value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
41protected override string FormatLiteral(byte value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
46protected override string FormatLiteral(short value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
51protected override string FormatLiteral(ushort value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
56protected override string FormatLiteral(int value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
61protected override string FormatLiteral(uint value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
66protected override string FormatLiteral(long value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
71protected override string FormatLiteral(ulong value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null)
76protected override string FormatLiteral(double value, CultureInfo cultureInfo = null)
81protected override string FormatLiteral(float value, CultureInfo cultureInfo = null)
86protected override string FormatLiteral(decimal value, CultureInfo cultureInfo = null)
91protected override string FormatLiteral(DateTime value, CultureInfo cultureInfo = null)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (29)
Semantics\ConstantTests.cs (25)
4027Assert.Equal("c", charConstant.ToString(null, CultureInfo.InvariantCulture));
4029Assert.Equal("4", byteConst.ToString(null, CultureInfo.InvariantCulture));
4030Assert.Equal("-1", sbyteConst.ToString(null, CultureInfo.InvariantCulture));
4032Assert.Equal("-1", shortConst.ToString(null, CultureInfo.InvariantCulture));
4033Assert.Equal("65535", ushortConst.ToString(null, CultureInfo.InvariantCulture));
4035Assert.Equal("-1", int32Const.ToString(null, CultureInfo.InvariantCulture));
4036Assert.Equal("4294967295", uint32Const.ToString(null, CultureInfo.InvariantCulture));
4038Assert.Equal("-1", nintConst.ToString(null, CultureInfo.InvariantCulture));
4039Assert.Equal("4294967295", nuintConst.ToString(null, CultureInfo.InvariantCulture));
4041Assert.Equal("-1", int64Const.ToString(null, CultureInfo.InvariantCulture));
4042Assert.Equal("18446744073709551615", uint64Const.ToString(null, CultureInfo.InvariantCulture));
4044Assert.Equal("0.3333333333333333333333333333", decimalConst.ToString(null, CultureInfo.InvariantCulture));
4045Assert.Equal("0.33333", floatConst.ToString(null, CultureInfo.InvariantCulture));
4046Assert.Equal("0.33333333", doubleConst.ToString(null, CultureInfo.InvariantCulture));
4048Assert.Equal(@"""abcdefghijklmnopqrstuvwxyz""", stringConst.ToString(null, CultureInfo.InvariantCulture));
4049Assert.Equal(@"""abcdefghijklmnopqrstuvwxyz""", stringConst.ToString("26", CultureInfo.InvariantCulture));
4050Assert.Equal(@"""abcdefghijklmnopqrstuvwxyz""", stringConst.ToString("27", CultureInfo.InvariantCulture));
4051Assert.Equal(@"""...""", stringConst.ToString("-1", CultureInfo.InvariantCulture));
4052Assert.Equal(@"""...""", stringConst.ToString("2", CultureInfo.InvariantCulture));
4053Assert.Equal(@"""...""", stringConst.ToString("3", CultureInfo.InvariantCulture));
4054Assert.Equal(@"""abcd...""", stringConst.ToString("7", CultureInfo.InvariantCulture));
4056Assert.Equal("12/31/9999 23:59:59", dateTimeConst.ToString(null, CultureInfo.InvariantCulture));
4058Assert.Equal("True", boolConst.ToString(null, CultureInfo.InvariantCulture));
4060Assert.Equal("bad", badConst.ToString(null, CultureInfo.InvariantCulture));
4061Assert.Equal("null", nullConst.ToString(null, CultureInfo.InvariantCulture));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (11)
SymbolDisplay\ObjectDisplayTests.cs (8)
287Assert.Equal("12.5", ObjectDisplay.FormatLiteral(decimalValue, ObjectDisplayOptions.None, CultureInfo.InvariantCulture));
288Assert.Equal("12,5", ObjectDisplay.FormatLiteral(decimalValue, ObjectDisplayOptions.None, CultureInfo.CurrentCulture));
294Assert.Equal("12.5", ObjectDisplay.FormatLiteral(doubleValue, ObjectDisplayOptions.None, CultureInfo.InvariantCulture));
295Assert.Equal("12,5", ObjectDisplay.FormatLiteral(doubleValue, ObjectDisplayOptions.None, CultureInfo.CurrentCulture));
301Assert.Equal("12.5", ObjectDisplay.FormatLiteral(singleValue, ObjectDisplayOptions.None, CultureInfo.InvariantCulture));
302Assert.Equal("12,5", ObjectDisplay.FormatLiteral(singleValue, ObjectDisplayOptions.None, CultureInfo.CurrentCulture));
308Assert.Equal("12", ObjectDisplay.FormatLiteral(intValue, ObjectDisplayOptions.None, CultureInfo.InvariantCulture));
309Assert.Equal("12", ObjectDisplay.FormatLiteral(intValue, ObjectDisplayOptions.None, CultureInfo.CurrentCulture));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (16)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Microsoft.CodeAnalysis.Debugging.Package (1)
Microsoft.CodeAnalysis.EditorFeatures (14)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (15)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (6)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (8)
Microsoft.CodeAnalysis.ExternalAccess.Extensions (1)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Microsoft.CodeAnalysis.Features (36)
Completion\PatternMatchHelper.cs (10)
21private static readonly CultureInfo EnUSCultureInfo;
33EnUSCultureInfo = CultureInfo.InvariantCulture;
38private readonly Dictionary<(CultureInfo, bool includeMatchedSpans), PatternMatcher> _patternMatcherMap = [];
42public ImmutableArray<TextSpan> GetHighlightedSpans(string text, CultureInfo culture)
48public PatternMatch? GetMatch(string text, bool includeMatchSpans, CultureInfo culture)
81private PatternMatcher GetPatternMatcher(CultureInfo culture, bool includeMatchedSpans)
101CultureInfo culture)
132public bool MatchesPattern(CompletionItem item, CultureInfo culture)
151? GetMatch(item.FilterText, includeMatchSpans, CultureInfo.CurrentCulture)
167var additionalMatch = GetMatch(additionalFilterText, includeMatchSpans, CultureInfo.CurrentCulture);
Microsoft.CodeAnalysis.InteractiveHost (13)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (21)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (5)
Microsoft.CodeAnalysis.PublicApiAnalyzers (5)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (5)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
Microsoft.CodeAnalysis.Scripting (33)
Hosting\ObjectFormatter\CommonPrimitiveFormatter.cs (12)
26protected abstract string FormatLiteral(sbyte value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
27protected abstract string FormatLiteral(byte value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
28protected abstract string FormatLiteral(short value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
29protected abstract string FormatLiteral(ushort value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
30protected abstract string FormatLiteral(int value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
31protected abstract string FormatLiteral(uint value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
32protected abstract string FormatLiteral(long value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
33protected abstract string FormatLiteral(ulong value, int numberRadix = NumberRadixDecimal, CultureInfo cultureInfo = null);
34protected abstract string FormatLiteral(double value, CultureInfo cultureInfo = null);
35protected abstract string FormatLiteral(float value, CultureInfo cultureInfo = null);
36protected abstract string FormatLiteral(decimal value, CultureInfo cultureInfo = null);
37protected abstract string FormatLiteral(DateTime value, CultureInfo cultureInfo = null);
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (7)
Microsoft.CodeAnalysis.Scripting.TestUtilities (6)
Microsoft.CodeAnalysis.Test.Utilities (69)
Microsoft.CodeAnalysis.UnitTests (30)
MetadataReferences\FusionAssemblyIdentityTests.cs (4)
101RoundTrip(new AssemblyIdentity("goo", cultureName: CultureInfo.CurrentCulture.Name).ToAssemblyName());
103RoundTrip(new AssemblyName("goo") { CultureInfo = CultureInfo.InvariantCulture });
107RoundTrip(new AssemblyIdentity("goo", version: new Version(1, 2, 3, 4), cultureName: CultureInfo.CurrentCulture.Name, publicKeyOrToken: new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }.AsImmutableOrNull()).ToAssemblyName());
181Assert.Equal(name.CultureInfo, CultureInfo.InvariantCulture);
Microsoft.CodeAnalysis.VisualBasic (84)
SymbolDisplay\ObjectDisplay.vb (15)
166Friend Function FormatLiteral(value As SByte, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
176Friend Function FormatLiteral(value As Byte, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
186Friend Function FormatLiteral(value As Short, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
206Friend Function FormatLiteral(value As UShort, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
226Friend Function FormatLiteral(value As Integer, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
246Friend Function FormatLiteral(value As UInteger, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
266Friend Function FormatLiteral(value As Long, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
286Friend Function FormatLiteral(value As ULong, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
306Friend Function FormatLiteral(value As Double, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
314Friend Function FormatLiteral(value As Single, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
322Friend Function FormatLiteral(value As Decimal, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
331Return value.ToString("#M/d/yyyy hh:mm:ss tt#", CultureInfo.InvariantCulture)
527Private Function GetFormatCulture(cultureInfo As CultureInfo) As CultureInfo
528Return If(cultureInfo, CultureInfo.InvariantCulture)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (61)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (7)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
Microsoft.CodeAnalysis.VisualBasic.Features (9)
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (15)
src\Compilers\VisualBasic\Portable\SymbolDisplay\ObjectDisplay.vb (15)
166Friend Function FormatLiteral(value As SByte, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
176Friend Function FormatLiteral(value As Byte, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
186Friend Function FormatLiteral(value As Short, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
206Friend Function FormatLiteral(value As UShort, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
226Friend Function FormatLiteral(value As Integer, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
246Friend Function FormatLiteral(value As UInteger, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
266Friend Function FormatLiteral(value As Long, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
286Friend Function FormatLiteral(value As ULong, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
306Friend Function FormatLiteral(value As Double, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
314Friend Function FormatLiteral(value As Single, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
322Friend Function FormatLiteral(value As Decimal, options As ObjectDisplayOptions, Optional cultureInfo As CultureInfo = Nothing) As String
331Return value.ToString("#M/d/yyyy hh:mm:ss tt#", CultureInfo.InvariantCulture)
527Private Function GetFormatCulture(cultureInfo As CultureInfo) As CultureInfo
528Return If(cultureInfo, CultureInfo.InvariantCulture)
Microsoft.CodeAnalysis.VisualBasic.Scripting (13)
Hosting\ObjectFormatter\VisualBasicPrimitiveFormatter.vb (12)
24Protected Overrides Function FormatLiteral(value As Date, Optional cultureInfo As CultureInfo = Nothing) As String
46Protected Overrides Function FormatLiteral(value As SByte, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
50Protected Overrides Function FormatLiteral(value As Byte, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
54Protected Overrides Function FormatLiteral(value As Short, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
58Protected Overrides Function FormatLiteral(value As UShort, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
62Protected Overrides Function FormatLiteral(value As Integer, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
66Protected Overrides Function FormatLiteral(value As UInteger, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
70Protected Overrides Function FormatLiteral(value As Long, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
74Protected Overrides Function FormatLiteral(value As ULong, Optional numberRadix As Integer = NumberRadixDecimal, Optional cultureInfo As CultureInfo = Nothing) As String
78Protected Overrides Function FormatLiteral(value As Double, Optional cultureInfo As CultureInfo = Nothing) As String
82Protected Overrides Function FormatLiteral(value As Single, Optional cultureInfo As CultureInfo = Nothing) As String
86Protected Overrides Function FormatLiteral(value As Decimal, Optional cultureInfo As CultureInfo = Nothing) As String
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (8)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (5)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (8)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (14)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (9)
CodeGeneration\SyntaxGeneratorTests.vb (9)
101VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1.00", CultureInfo.InvariantCulture)), "1.00D")
102VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("-1.00", CultureInfo.InvariantCulture)), "-1.00D")
103VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1.0000000000", CultureInfo.InvariantCulture)), "1.0000000000D")
104VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("0.000000", CultureInfo.InvariantCulture)), "0.000000D")
105VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("0.0000000", CultureInfo.InvariantCulture)), "0.0000000D")
108VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1E-28", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000001D")
109VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("0E-28", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D")
110VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("1E-29", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D")
111VerifySyntax(Of LiteralExpressionSyntax)(Generator.LiteralExpression(Decimal.Parse("-1E-29", NumberStyles.Any, CultureInfo.InvariantCulture)), "0.0000000000000000000000000000D")
Microsoft.CodeAnalysis.Workspaces (35)
Shared\Extensions\ISymbolExtensions.cs (2)
221public static DocumentationComment GetDocumentationComment(this ISymbol symbol, Compilation compilation, CultureInfo? preferredCulture = null, bool expandIncludes = false, bool expandInheritdoc = false, CancellationToken cancellationToken = default)
224private static DocumentationComment GetDocumentationComment(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, CultureInfo? preferredCulture, bool expandIncludes, bool expandInheritdoc, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (27)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.CSharp (9)
Microsoft.Data.Analysis (21)
DataFrame.IO.cs (11)
111bool renameDuplicatedColumns = false, CultureInfo cultureInfo = null)
360CultureInfo cultureInfo = null, Func<IEnumerable<string>, Type> guessTypeFunction = null)
364cultureInfo = CultureInfo.CurrentCulture;
545CultureInfo cultureInfo = null, Func<IEnumerable<string>, Type> guessTypeFunction = null)
571Encoding encoding = null, bool renameDuplicatedColumns = false, CultureInfo cultureInfo = null,
600Encoding encoding = null, CultureInfo cultureInfo = null)
616Encoding encoding = null, CultureInfo cultureInfo = null)
638Encoding encoding = null, CultureInfo cultureInfo = null)
654Encoding encoding = null, CultureInfo cultureInfo = null)
658cultureInfo = CultureInfo.CurrentCulture;
694private static void AppendValuesToRecord(StringBuilder record, IEnumerable values, char separator, CultureInfo cultureInfo)
Microsoft.Data.Analysis.Tests (16)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.DotNet.Build.Tasks.TargetFramework (2)
Microsoft.DotNet.Build.Tasks.Workloads (2)
Microsoft.DotNet.GenAPI (1)
Microsoft.DotNet.Helix.Client (5)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.Open.Api.Tools.Tests (1)
Microsoft.DotNet.SharedFramework.Sdk (1)
Microsoft.DotNet.SignCheckLibrary (6)
Microsoft.DotNet.SignCheckTask (2)
Microsoft.Extensions.AI.Abstractions (2)
Microsoft.Extensions.AI.Evaluation (1)
Microsoft.Extensions.AI.Evaluation.NLP (3)
Microsoft.Extensions.AI.Evaluation.Reporting (7)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (9)
Storage\AzureStorageResponseCache.cs (6)
102CultureInfo.CurrentCulture,
123CultureInfo.CurrentCulture,
255? string.Format(CultureInfo.CurrentCulture, EntryFileNotFound, entryFilePath)
256: string.Format(CultureInfo.CurrentCulture, ContentsFileNotFound, contentsFilePath));
278? string.Format(CultureInfo.CurrentCulture, EntryFileNotFound, entryFilePath)
279: string.Format(CultureInfo.CurrentCulture, ContentsFileNotFound, contentsFilePath));
Microsoft.Extensions.AI.Ollama (2)
Microsoft.Extensions.AI.OpenAI (2)
Microsoft.Extensions.ApiDescription.Client (1)
Microsoft.Extensions.ApiDescription.Client.Tests (1)
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Caching.SqlServer (7)
SqlQueries.cs (7)
60CultureInfo.InvariantCulture,
64GetCacheItem = string.Format(CultureInfo.InvariantCulture, UpdateCacheItemFormat + GetCacheItemFormat, tableNameWithSchema);
65GetCacheItemWithoutValue = string.Format(CultureInfo.InvariantCulture, UpdateCacheItemFormat, tableNameWithSchema);
66DeleteCacheItem = string.Format(CultureInfo.InvariantCulture, DeleteCacheItemFormat, tableNameWithSchema);
67DeleteExpiredCacheItems = string.Format(CultureInfo.InvariantCulture, DeleteExpiredCacheItemsFormat, tableNameWithSchema);
68SetCacheItem = string.Format(CultureInfo.InvariantCulture, SetCacheItemFormat, tableNameWithSchema);
69TableInfo = string.Format(CultureInfo.InvariantCulture, TableInfoFormat, EscapeLiteral(schemaName), EscapeLiteral(tableName));
Microsoft.Extensions.Caching.SqlServer.Tests (5)
Microsoft.Extensions.Compliance.Abstractions (1)
Microsoft.Extensions.Compliance.Redaction (4)
Microsoft.Extensions.Compliance.Redaction.Tests (1)
Microsoft.Extensions.Compliance.Testing (3)
Microsoft.Extensions.Compliance.Testing.Tests (1)
Microsoft.Extensions.Configuration.Xml (1)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (2)
Microsoft.Extensions.Diagnostics.Probes (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (23)
Linux\Disk\DiskStatsReader.cs (19)
83MajorNumber = int.Parse(parts[0], CultureInfo.InvariantCulture),
84MinorNumber = int.Parse(parts[1], CultureInfo.InvariantCulture),
86ReadsCompleted = ulong.Parse(parts[3], CultureInfo.InvariantCulture),
87ReadsMerged = ulong.Parse(parts[4], CultureInfo.InvariantCulture),
88SectorsRead = ulong.Parse(parts[5], CultureInfo.InvariantCulture),
89TimeReadingMs = uint.Parse(parts[6], CultureInfo.InvariantCulture),
90WritesCompleted = ulong.Parse(parts[7], CultureInfo.InvariantCulture),
91WritesMerged = ulong.Parse(parts[8], CultureInfo.InvariantCulture),
92SectorsWritten = ulong.Parse(parts[9], CultureInfo.InvariantCulture),
93TimeWritingMs = uint.Parse(parts[10], CultureInfo.InvariantCulture),
94IoInProgress = uint.Parse(parts[11], CultureInfo.InvariantCulture),
95TimeIoMs = uint.Parse(parts[12], CultureInfo.InvariantCulture),
96WeightedTimeIoMs = uint.Parse(parts[13], CultureInfo.InvariantCulture)
102diskStats.DiscardsCompleted = ulong.Parse(parts[14], CultureInfo.InvariantCulture);
103diskStats.DiscardsMerged = ulong.Parse(parts[15], CultureInfo.InvariantCulture);
104diskStats.SectorsDiscarded = ulong.Parse(parts[16], CultureInfo.InvariantCulture);
105diskStats.TimeDiscardingMs = uint.Parse(parts[17], CultureInfo.InvariantCulture);
110diskStats.FlushRequestsCompleted = ulong.Parse(parts[18], CultureInfo.InvariantCulture);
111diskStats.TimeFlushingMs = uint.Parse(parts[19], CultureInfo.InvariantCulture);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Microsoft.Extensions.Diagnostics.Testing (3)
Microsoft.Extensions.Diagnostics.Testing.Tests (5)
Microsoft.Extensions.Hosting (2)
Microsoft.Extensions.Http.Diagnostics (3)
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Microsoft.Extensions.Http.Polly (1)
Microsoft.Extensions.Http.Resilience (4)
Microsoft.Extensions.Http.Resilience.Tests (1)
Microsoft.Extensions.Identity.Core (3)
Microsoft.Extensions.Localization (16)
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
Microsoft.Extensions.Localization.Tests (9)
Microsoft.Extensions.Logging.Abstractions (10)
LogValuesFormatter.cs (10)
69vsb.Append(_valueNames.Count.ToString(CultureInfo.InvariantCulture));
160return string.Format(CultureInfo.InvariantCulture, _format, formattedValues ?? Array.Empty<object>());
174return string.Format(CultureInfo.InvariantCulture, _format, values ?? Array.Empty<object>());
191string.Format(CultureInfo.InvariantCulture, _format, arg0) :
192string.Format(CultureInfo.InvariantCulture, _format, arg0String);
199string.Format(CultureInfo.InvariantCulture, _format, arg0String ?? arg0, arg1String ?? arg1) :
200string.Format(CultureInfo.InvariantCulture, _format, arg0, arg1);
207string.Format(CultureInfo.InvariantCulture, _format, arg0String ?? arg0, arg1String ?? arg1, arg2String ?? arg2):
208string.Format(CultureInfo.InvariantCulture, _format, arg0, arg1, arg2);
274e is IFormattable f ? f.ToString(null, CultureInfo.InvariantCulture) :
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.Logging.Console (1)
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
Microsoft.Extensions.Options.SourceGeneration (1)
Microsoft.Extensions.Resilience.Tests (2)
Microsoft.Extensions.SecretManager.Tools.Tests (10)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (2)
Microsoft.Extensions.Telemetry (10)
Latency\Internal\LatencyConsoleExporter.cs (5)
51CultureInfo.InvariantCulture,
72_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, c.Name, (double)c.Elapsed / c.Frequency * MillisPerSecond);
88_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, t.Name, t.Value);
104_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, m.Name, m.Value);
134_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, nameHeader, valueHeader);
Microsoft.Extensions.Telemetry.Abstractions (3)
Microsoft.Extensions.Telemetry.Tests (7)
Microsoft.Extensions.TimeProvider.Testing (1)
Microsoft.Extensions.Validation.GeneratorTests (1)
Microsoft.Gen.ComplianceReports (3)
Microsoft.Gen.ContextualOptions (3)
Microsoft.Gen.ContextualOptions.Generated.Tests (2)
Microsoft.Gen.Logging (2)
Microsoft.Gen.Logging.Generated.Tests (48)
LogPropertiesTests.cs (32)
64Assert.Equal(props.P0.ToString(CultureInfo.InvariantCulture), state!.GetValue("P0"));
81Assert.Equal(props.P0.ToString(CultureInfo.InvariantCulture), state!.GetValue("P0"));
125Assert.Equal(props.P0.ToString(CultureInfo.InvariantCulture), state!.GetValue("p.P0"));
126Assert.Equal(props.P1.ToString(CultureInfo.InvariantCulture), state!.GetValue("p.P1"));
127Assert.Equal(props.P2.ToString(null, CultureInfo.InvariantCulture), state!.GetValue("p.P2"));
135Assert.Equal(props.P10.ToString(CultureInfo.InvariantCulture), state!.GetValue("p.P10"));
136Assert.Equal(props.P11.ToString(CultureInfo.InvariantCulture), state!.GetValue("p.P11"));
146Assert.Equal(props.P19.ToString(CultureInfo.InvariantCulture), state!.GetValue("p.P19"));
147Assert.Equal(props.P20.ToString(CultureInfo.InvariantCulture), state!.GetValue("p.P20"));
180Assert.Equal(props.P2.ToString(null, CultureInfo.InvariantCulture), ss["p.P2"]);
196Assert.Equal(props.P2.ToString(null, CultureInfo.InvariantCulture), ss["p.P2"]);
237["classToLog.GetOnlyProperty"] = classToLog.GetOnlyProperty.ToString(CultureInfo.InvariantCulture),
242= classToLog.TransitiveProperty.TransitiveNumberProp.ToString(CultureInfo.InvariantCulture),
246= classToLog.TransitiveProperty.InnerTransitiveProperty.IntegerProperty.ToString(CultureInfo.InvariantCulture),
248= classToLog.TransitiveProperty.InnerTransitiveProperty.DateTimeProperty.ToString(CultureInfo.InvariantCulture),
253["classToLog.InterimProperty"] = classToLog.InterimProperty.ToString(CultureInfo.InvariantCulture),
262= classToLog.CustomStructProperty.TransitiveStructProperty.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
265= classToLog.CustomStructProperty.NullableTransitiveStructProperty?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
268= classToLog.CustomStructProperty.NullableTransitiveStructProperty2?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
272= classToLog.CustomStructNullableProperty?.TransitiveStructProperty.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
275= classToLog.CustomStructNullableProperty?.NullableTransitiveStructProperty?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
278= classToLog.CustomStructNullableProperty?.NullableTransitiveStructProperty2?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
282= classToLog.CustomStructNullableProperty2?.TransitiveStructProperty.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
285= classToLog.CustomStructNullableProperty2?.NullableTransitiveStructProperty?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
288= classToLog.CustomStructNullableProperty2?.NullableTransitiveStructProperty2?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
396= structToLog.TransitiveStructProperty.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
399= structToLog.NullableTransitiveStructProperty?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
402= structToLog.NullableTransitiveStructProperty2.Value.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
426= structToLog.Value.TransitiveStructProperty.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
429= structToLog.Value.NullableTransitiveStructProperty.Value.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
432= structToLog.Value.NullableTransitiveStructProperty2?.DateTimeOffsetProperty.ToString(CultureInfo.InvariantCulture),
533["p0.event"] = recordToLog.@event.ToString(CultureInfo.InvariantCulture)
Microsoft.Gen.MetadataExtractor (7)
Microsoft.Gen.Metrics (4)
Microsoft.Gen.Metrics.Generated.Tests (1)
Microsoft.Gen.MetricsReports (3)
Microsoft.JSInterop (1)
Microsoft.Maui (73)
Converters\CornerRadiusTypeConverter.cs (21)
16 public override object ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object? value)
33 && double.TryParse(cornerRadius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double tl)
34 && double.TryParse(cornerRadius[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double tr)
35 && double.TryParse(cornerRadius[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double bl)
36 && double.TryParse(cornerRadius[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double br))
40 && double.TryParse(cornerRadius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double l))
47 && double.TryParse(cornerRadius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double t)
48 && double.TryParse(cornerRadius[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double b))
51 && double.TryParse(cornerRadius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double tl)
52 && double.TryParse(cornerRadius[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double trbl)
53 && double.TryParse(cornerRadius[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double br))
56 && double.TryParse(cornerRadius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out tl)
57 && double.TryParse(cornerRadius[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double tr)
58 && double.TryParse(cornerRadius[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double bl)
59 && double.TryParse(cornerRadius[3], NumberStyles.Number, CultureInfo.InvariantCulture, out br))
64 if (double.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out double l))
72 public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
77 return $"{cr.TopLeft.ToString(CultureInfo.InvariantCulture)}, {cr.TopRight.ToString(CultureInfo.InvariantCulture)}, " +
78 $"{cr.BottomLeft.ToString(CultureInfo.InvariantCulture)}, {cr.BottomRight.ToString(CultureInfo.InvariantCulture)}";
Converters\FlexEnumsConverters.cs (18)
18 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
39 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
57 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
74 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
92 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
113 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
131 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
148 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
166 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
183 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
201 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
216 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
234 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
251 if (float.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out float flex))
258 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
266 return $"{(basis.Length * 100).ToString(CultureInfo.InvariantCulture)}%";
268 return $"{basis.Length.ToString(CultureInfo.InvariantCulture)}";
286 return float.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out relflex);
Converters\ThicknessTypeConverter.cs (22)
21 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
45 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double h)
46 && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double v))
50 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double l)
51 && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double t)
52 && double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double r)
53 && double.TryParse(thickness[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double b))
64 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double v)
65 && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double h))
69 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double t)
70 && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out h)
71 && double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double b))
75 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out t)
76 && double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double r)
77 && double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out b)
78 && double.TryParse(thickness[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double l))
85 if (double.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out double l))
93 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
98 return $"{t.Left.ToString(CultureInfo.InvariantCulture)}, {t.Top.ToString(CultureInfo.InvariantCulture)}, " +
99 $"{t.Right.ToString(CultureInfo.InvariantCulture)}, {t.Bottom.ToString(CultureInfo.InvariantCulture)}";
Microsoft.Maui.Controls (174)
FontSizeConverter.cs (5)
24 if (double.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out double size))
65 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
71 if (double.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out double size))
103 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
107 return $"{d.ToString(CultureInfo.InvariantCulture)}";
GridLengthTypeConverter.cs (6)
18 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
30 if (strValue.EndsWith("*", StringComparison.Ordinal) && double.TryParse(strValue.Substring(0, strValue.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var length))
32 if (double.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out length))
38 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
45 return $"{length.Value.ToString(CultureInfo.InvariantCulture)}*";
46 return $"{length.Value.ToString(CultureInfo.InvariantCulture)}";
Layout\BoundsTypeConverter.cs (10)
19 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
30 hasX = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x);
31 hasY = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y);
32 hasW = xywh.Length == 4 && double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out w);
33 hasH = xywh.Length == 4 && double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out h);
56 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
60 return $"{rect.X.ToString(CultureInfo.InvariantCulture)}, {rect.Y.ToString(CultureInfo.InvariantCulture)}, {(rect.Width == AbsoluteLayout.AutoSize ? nameof(AbsoluteLayout.AutoSize) : rect.Width.ToString(CultureInfo.InvariantCulture))}, {(rect.Height == AbsoluteLayout.AutoSize ? nameof(AbsoluteLayout.AutoSize) : rect.Height.ToString(CultureInfo.InvariantCulture))}";
ShadowTypeConverter.cs (15)
47 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
85 var offsetX = float.Parse(matches[1].Value, CultureInfo.InvariantCulture);
86 var offsetY = float.Parse(matches[2].Value, CultureInfo.InvariantCulture);
96 var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture);
97 var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture);
98 var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture);
110 var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture);
111 var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture);
112 var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture);
114 var opacity = float.Parse(matches[4].Value, CultureInfo.InvariantCulture);
143 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
152 var offsetX = shadow.Offset.X.ToString(CultureInfo.InvariantCulture);
153 var offsetY = shadow.Offset.Y.ToString(CultureInfo.InvariantCulture);
154 var radius = shadow.Radius.ToString(CultureInfo.InvariantCulture);
156 var opacity = shadow.Opacity.ToString(CultureInfo.InvariantCulture);
Shapes\MatrixTypeConverter.cs (9)
17 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
33 if (!double.TryParse(strs[i], NumberStyles.Number, CultureInfo.InvariantCulture, out values[i]))
39 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
43 return $"{matrix.M11.ToString(CultureInfo.InvariantCulture)}, {matrix.M12.ToString(CultureInfo.InvariantCulture)}, {matrix.M21.ToString(CultureInfo.InvariantCulture)}, {matrix.M22.ToString(CultureInfo.InvariantCulture)}, {matrix.OffsetX.ToString(CultureInfo.InvariantCulture)}, {matrix.OffsetY.ToString(CultureInfo.InvariantCulture)}";
Xaml\TypeConversionExtensions.cs (13)
175 return SByte.Parse(str, CultureInfo.InvariantCulture);
177 return Int16.Parse(str, CultureInfo.InvariantCulture);
179 return Int32.Parse(str, CultureInfo.InvariantCulture);
181 return Int64.Parse(str, CultureInfo.InvariantCulture);
183 return Byte.Parse(str, CultureInfo.InvariantCulture);
185 return UInt16.Parse(str, CultureInfo.InvariantCulture);
187 return UInt32.Parse(str, CultureInfo.InvariantCulture);
189 return UInt64.Parse(str, CultureInfo.InvariantCulture);
191 return Single.Parse(str, CultureInfo.InvariantCulture);
193 return Double.Parse(str, CultureInfo.InvariantCulture);
197 return TimeSpan.Parse(str, CultureInfo.InvariantCulture);
199 return DateTime.Parse(str, CultureInfo.InvariantCulture);
210 return Decimal.Parse(str, CultureInfo.InvariantCulture);
Microsoft.Maui.Controls.BindingSourceGen (1)
Microsoft.Maui.Controls.Build.Tasks (53)
CompiledConverters\BoundsTypeConverter.cs (4)
28 hasX = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x);
29 hasY = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y);
30 hasW = xywh.Length == 4 && double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out w);
31 hasH = xywh.Length == 4 && double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out h);
CompiledConverters\CornerRadiusTypeConverter.cs (5)
24 if (double.TryParse(cornerradius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out l))
28 if (double.TryParse(cornerradius[0], NumberStyles.Number, CultureInfo.InvariantCulture, out tl)
29 && double.TryParse(cornerradius[1], NumberStyles.Number, CultureInfo.InvariantCulture, out tr)
30 && double.TryParse(cornerradius[2], NumberStyles.Number, CultureInfo.InvariantCulture, out bl)
31 && double.TryParse(cornerradius[3], NumberStyles.Number, CultureInfo.InvariantCulture, out br))
CompiledConverters\RectangleTypeConverter.cs (4)
23 !double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x) ||
24 !double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y) ||
25 !double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out w) ||
26 !double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out h))
CompiledConverters\ThicknessTypeConverter.cs (7)
24 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out l))
28 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out l) &&
29 double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out t))
33 if (double.TryParse(thickness[0], NumberStyles.Number, CultureInfo.InvariantCulture, out l) &&
34 double.TryParse(thickness[1], NumberStyles.Number, CultureInfo.InvariantCulture, out t) &&
35 double.TryParse(thickness[2], NumberStyles.Number, CultureInfo.InvariantCulture, out r) &&
36 double.TryParse(thickness[3], NumberStyles.Number, CultureInfo.InvariantCulture, out b))
CreateObjectVisitor.cs (12)
401 if (hasValue && sbyte.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out sbyte outsbyte))
407 if (hasValue && short.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out short outshort))
413 if (hasValue && int.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out int outint))
419 if (hasValue && long.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out long outlong))
425 if (hasValue && byte.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out byte outbyte))
431 if (hasValue && short.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out short outushort))
437 if (hasValue && int.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out int outuint))
443 if (hasValue && long.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out long outulong))
472 if (hasValue && decimal.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out outdecimal))
508 if (hasValue && float.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out float outfloat))
514 if (hasValue && double.TryParse(valueString, NumberStyles.Number, CultureInfo.InvariantCulture, out double outdouble))
520 if (hasValue && TimeSpan.TryParse(valueString, CultureInfo.InvariantCulture, out TimeSpan outspan))
NodeILExtensions.cs (13)
237 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => SByte.Parse(s, CultureInfo.InvariantCulture), node, str)));
239 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => Int16.Parse(s, CultureInfo.InvariantCulture), node, str)));
241 yield return Instruction.Create(OpCodes.Ldc_I4, TryFormat(s => Int32.Parse(s, CultureInfo.InvariantCulture), node, str));
243 yield return Instruction.Create(OpCodes.Ldc_I8, TryFormat(s => Int64.Parse(s, CultureInfo.InvariantCulture), node, str));
245 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => Byte.Parse(s, CultureInfo.InvariantCulture), node, str)));
247 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => UInt16.Parse(s, CultureInfo.InvariantCulture), node, str)));
249 yield return Instruction.Create(OpCodes.Ldc_I4, unchecked((int)TryFormat(s => UInt32.Parse(s, CultureInfo.InvariantCulture), node, str)));
251 yield return Instruction.Create(OpCodes.Ldc_I8, unchecked((long)TryFormat(s => UInt64.Parse(s, CultureInfo.InvariantCulture), node, str)));
253 yield return Instruction.Create(OpCodes.Ldc_R4, TryFormat(s => Single.Parse(str, CultureInfo.InvariantCulture), node, str));
255 yield return Instruction.Create(OpCodes.Ldc_R8, TryFormat(s => Double.Parse(str, CultureInfo.InvariantCulture), node, str));
265 var ts = TryFormat(s => TimeSpan.Parse(s, CultureInfo.InvariantCulture), node, str);
272 var dt = TryFormat(s => DateTime.Parse(s, CultureInfo.InvariantCulture), node, str);
286 if (decimal.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out outdecimal))
Microsoft.Maui.Controls.DesignTools (12)
Microsoft.Maui.Controls.SourceGen (2)
Microsoft.Maui.Controls.Xaml (14)
CreateValuesVisitor.cs (12)
349 if (nodeType == typeof(SByte) && sbyte.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var sbyteval))
351 if (nodeType == typeof(Int16) && short.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var int16val))
353 if (nodeType == typeof(Int32) && int.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var int32val))
355 if (nodeType == typeof(Int64) && long.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var int64val))
357 if (nodeType == typeof(Byte) && byte.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var byteval))
359 if (nodeType == typeof(UInt16) && ushort.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var uint16val))
361 if (nodeType == typeof(UInt32) && uint.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var uint32val))
363 if (nodeType == typeof(UInt64) && ulong.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var uint64val))
365 if (nodeType == typeof(Single) && float.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var singleval))
367 if (nodeType == typeof(Double) && double.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var doubleval))
371 if (nodeType == typeof(TimeSpan) && TimeSpan.TryParse(valuestring, CultureInfo.InvariantCulture, out TimeSpan timespanval))
377 if (nodeType == typeof(decimal) && decimal.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var decimalval))
Microsoft.Maui.Graphics (115)
Rect.cs (8)
24 return string.Format("{{X={0} Y={1} Width={2} Height={3}}}", X.ToString(CultureInfo.InvariantCulture), Y.ToString(CultureInfo.InvariantCulture), Width.ToString(CultureInfo.InvariantCulture), Height.ToString(CultureInfo.InvariantCulture));
229 && double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out double x)
230 && double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out double y)
231 && double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out double w)
232 && double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out double h))
RectF.cs (8)
24 return string.Format("{{X={0} Y={1} Width={2} Height={3}}}", X.ToString(CultureInfo.InvariantCulture), Y.ToString(CultureInfo.InvariantCulture), Width.ToString(CultureInfo.InvariantCulture),
25 Height.ToString(CultureInfo.InvariantCulture));
229 && float.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out float x)
230 && float.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out float y)
231 && float.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out float w)
232 && float.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out float h))
Text\TextColors.cs (20)
173 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
174 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
175 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
180 red = int.Parse($"{color[1]}{color[1]}", NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
181 green = int.Parse($"{color[2]}{color[2]}", NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
182 blue = int.Parse($"{color[3]}{color[3]}", NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
187 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
188 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
189 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
190 alpha = int.Parse(color.Substring(7, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
216 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
217 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
218 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
223 red = int.Parse($"{color[1]}{color[1]}", NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
224 green = int.Parse($"{color[2]}{color[2]}", NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
225 blue = int.Parse($"{color[3]}{color[3]}", NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
230 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
231 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
232 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
233 alpha = int.Parse(color.Substring(7, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
Microsoft.Maui.Resizetizer (11)
Microsoft.ML.AutoML (11)
AutoMLExperiment\ITrialResultManager.cs (6)
107trialResult.TrialSettings.TrialId.ToString(CultureInfo.InvariantCulture),
108trialResult.Loss.ToString("F3", CultureInfo.InvariantCulture),
109trialResult.DurationInMilliseconds.ToString("F3", CultureInfo.InvariantCulture),
110trialResult.PeakCpu?.ToString("F3", CultureInfo.InvariantCulture),
111trialResult.PeakMemoryInMegaByte?.ToString("F3", CultureInfo.InvariantCulture),
112}.Concat(parameter.Select(p => p.ToString("F3", CultureInfo.InvariantCulture))));
Microsoft.ML.AutoML.SourceGenerator (39)
SearchSpaceGenerator.cs (24)
70(_, "int") => $"{defaultToken.GetValue<int>().ToString(CultureInfo.InvariantCulture)}",
71(_, "double") => $"{defaultToken.GetValue<double>().ToString(CultureInfo.InvariantCulture)}",
72(_, "float") => $"{defaultToken.GetValue<float>().ToString(CultureInfo.InvariantCulture)}F",
102("int", _, _, _, null) => $"Range((int){Convert.ToInt32(minValue).ToString(CultureInfo.InvariantCulture)}, (int){Convert.ToInt32(maxValue).ToString(CultureInfo.InvariantCulture)}, logBase: {logBase.ToString(CultureInfo.InvariantCulture)})",
103("float", _, _, _, null) => $"Range((float){Convert.ToSingle(minValue).ToString(CultureInfo.InvariantCulture)}, (float){Convert.ToSingle(maxValue).ToString(CultureInfo.InvariantCulture)}, logBase: {logBase.ToString(CultureInfo.InvariantCulture)})",
104("double", _, _, _, null) => $"Range((double){minValue.ToString(CultureInfo.InvariantCulture)}, (double){maxValue.ToString(CultureInfo.InvariantCulture)}, logBase: {logBase.ToString(CultureInfo.InvariantCulture)})",
105("int", _, _, _, _) => $"Range((int){Convert.ToInt32(minValue).ToString(CultureInfo.InvariantCulture)}, (int){Convert.ToInt32(maxValue).ToString(CultureInfo.InvariantCulture)}, init: (int){optionDefaultValue.ToString(CultureInfo.InvariantCulture)}, logBase: {logBase.ToString(CultureInfo.InvariantCulture)})",
106("float", _, _, _, _) => $"Range((float){Convert.ToSingle(minValue).ToString(CultureInfo.InvariantCulture)}, (float){Convert.ToSingle(maxValue).ToString(CultureInfo.InvariantCulture)}, init: (float){optionDefaultValue.ToString(CultureInfo.InvariantCulture)}, logBase: {logBase.ToString(CultureInfo.InvariantCulture)})",
107("double", _, _, _, _) => $"Range((double){minValue.ToString(CultureInfo.InvariantCulture)}, (double){maxValue.ToString(CultureInfo.InvariantCulture)}, init: (double){optionDefaultValue.ToString(CultureInfo.InvariantCulture)}, logBase: {logBase.ToString(CultureInfo.InvariantCulture)})",
Microsoft.ML.AutoML.Tests (3)
Microsoft.ML.CodeGenerator (36)
Microsoft.ML.CodeGenerator.Tests (1)
Microsoft.ML.Core (11)
Utilities\Contracts.cs (7)
70msg = string.Format(CultureInfo.InvariantCulture, msg, args);
806DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}", paramName));
810DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}", paramName), ctx);
814DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}: {1}", paramName, msg));
818DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}: {1}", paramName, msg), ctx);
826DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-empty assertion failure: {0}", msg));
830DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-empty assertion failure: {0}", msg), ctx);
Microsoft.ML.CpuMath (7)
src\Microsoft.ML.Core\Utilities\Contracts.cs (7)
70msg = string.Format(CultureInfo.InvariantCulture, msg, args);
806DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}", paramName));
810DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}", paramName), ctx);
814DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}: {1}", paramName, msg));
818DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-null assertion failure: {0}: {1}", paramName, msg), ctx);
826DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-empty assertion failure: {0}", msg));
830DbgFailCore(string.Format(CultureInfo.InvariantCulture, "Non-empty assertion failure: {0}", msg), ctx);
Microsoft.ML.CpuMath.UnitTests (12)
UnitTests.cs (12)
350float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
376float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
402float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
429float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
456float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
483float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
512float defaultScale = float.Parse("1.7", CultureInfo.InvariantCulture);
682float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
730float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
783float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
935float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
965float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
Microsoft.ML.Data (12)
Data\Conversion.cs (9)
924public void Convert(in R4 src, ref SB dst) { ClearDst(ref dst); if (R4.IsNaN(src)) dst.AppendFormat(CultureInfo.InvariantCulture, "{0}", "?"); else dst.AppendFormat(CultureInfo.InvariantCulture, "{0:R}", src); }
925public void Convert(in R8 src, ref SB dst) { ClearDst(ref dst); if (R8.IsNaN(src)) dst.AppendFormat(CultureInfo.InvariantCulture, "{0}", "?"); else dst.AppendFormat(CultureInfo.InvariantCulture, "{0:G17}", src); }
949public void Convert(in R4 src, ref TX dst) => dst = src.ToString("G7", CultureInfo.InvariantCulture).AsMemory();
950public void Convert(in R8 src, ref TX dst) => dst = src.ToString("G17", CultureInfo.InvariantCulture).AsMemory();
1409if (TimeSpan.TryParse(src.ToString(), CultureInfo.InvariantCulture, out dst))
1426if (DateTime.TryParse(src.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out dst))
1443if (DateTimeOffset.TryParse(src.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out dst))
Microsoft.ML.DataView (1)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.ML.LightGbm (7)
Microsoft.ML.Maml (5)
Microsoft.ML.PerformanceTests (3)
Microsoft.ML.ResultProcessor (3)
Microsoft.ML.SearchSpace.Tests (2)
Microsoft.ML.StandardTrainers (2)
Microsoft.ML.Sweeper (1)
Microsoft.ML.Sweeper.Tests (4)
Microsoft.ML.TestFramework (2)
Microsoft.ML.Tests (2)
Microsoft.ML.Tokenizers (1)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.ML.Transforms (5)
Microsoft.Net.Http.Headers (22)
Microsoft.Net.Http.Headers.Tests (3)
Microsoft.NET.StringTools (1)
Microsoft.NET.StringTools.net35 (1)
Microsoft.VisualBasic.Core (43)
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (3)
145Public Overrides Function BindToMethod(ByVal bindingAttr As BindingFlags, ByVal match() As MethodBase, ByRef args() As Object, ByVal modifiers() As ParameterModifier, ByVal culture As CultureInfo, ByVal names() As String, ByRef ObjState As Object) As MethodBase
1570Public Overrides Function BindToField(ByVal bindingAttr As BindingFlags, ByVal match() As FieldInfo, ByVal value As Object, ByVal culture As CultureInfo) As FieldInfo
1756Public Overrides Function ChangeType(ByVal value As Object, ByVal typ As Type, ByVal culture As CultureInfo) As Object
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (8)
919Throw New MalformedLineException(SR.Format(SR.TextFieldParser_MalFormedDelimitedLine, CurrentLineNumber.ToString(CultureInfo.InvariantCulture)), CurrentLineNumber)
939Throw New MalformedLineException(SR.Format(SR.TextFieldParser_MalFormedDelimitedLine, CurrentLineNumber.ToString(CultureInfo.InvariantCulture)), CurrentLineNumber)
945Throw New MalformedLineException(SR.Format(SR.TextFieldParser_MaxLineSizeExceeded, CurrentLineNumber.ToString(CultureInfo.InvariantCulture)), CurrentLineNumber)
954Throw New MalformedLineException(SR.Format(SR.TextFieldParser_MalFormedDelimitedLine, CurrentLineNumber.ToString(CultureInfo.InvariantCulture)), CurrentLineNumber)
1104Throw New MalformedLineException(SR.Format(SR.TextFieldParser_MalFormedFixedWidthLine, LineNumber.ToString(CultureInfo.InvariantCulture)), LineNumber)
1347Dim pattern As String = String.Format(CultureInfo.InvariantCulture, BEGINS_WITH_QUOTE, WhitespacePattern)
1362Return String.Format(CultureInfo.InvariantCulture, ENDING_QUOTE, WhitespacePattern)
1398builder.Append("\u" & code.ToString("X4", CultureInfo.InvariantCulture))
Microsoft.VisualBasic.Forms (20)
Microsoft.VisualBasic.Tests (3)
Microsoft.VisualStudio.LanguageServices (17)
Microsoft.VisualStudio.LanguageServices.CSharp (5)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
MinimalFormSample (1)
mscorlib (1)
Mvc.Api.Analyzers.Test (5)
MyFrontend (2)
netstandard (1)
OpenIdConnectSample (1)
OutputCachingSample (1)
PresentationBuildTasks (40)
PresentationCore (410)
MS\Internal\IListConverters.cs (14)
44public override object ConvertFrom(ITypeDescriptorContext td, CultureInfo ci, object value)
64public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
76internal abstract object ConvertFromCore(ITypeDescriptorContext td, CultureInfo ci, string value);
81internal abstract object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType);
93internal sealed override object ConvertFromCore(ITypeDescriptorContext td, CultureInfo ci, string value)
107internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
138internal override object ConvertFromCore(ITypeDescriptorContext td, CultureInfo ci, string value)
149internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
179internal override object ConvertFromCore(ITypeDescriptorContext td, CultureInfo ci, string value)
190internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
220internal override object ConvertFromCore(ITypeDescriptorContext td, CultureInfo ci, string value)
232internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
265internal override object ConvertFromCore(ITypeDescriptorContext td, CultureInfo ci, string value)
270internal override object ConvertToCore(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
MS\Internal\Shaping\TypefaceMap.cs (23)
38private IDictionary<CultureInfo, IntMap> _intMaps = new Dictionary<CultureInfo, IntMap>();
72CultureInfo digitCulture,
88CultureInfo culture = textRunProperties.CultureInfo;
229CultureInfo culture,
235CultureInfo digitCulture = ((MS.Internal.Text.TextInterface.ItemProps)itemSpan.element).DigitCulture;
306CultureInfo culture,
307CultureInfo digitCulture,
364CultureInfo culture,
365CultureInfo digitCulture,
418CultureInfo.InvariantCulture,
481CultureInfo culture,
482CultureInfo digitCulture,
661CultureInfo culture,
662CultureInfo digitCulture,
709CultureInfo culture,
710CultureInfo digitCulture,
762CultureInfo culture,
763CultureInfo digitCulture,
850CultureInfo culture,
851CultureInfo digitCulture,
974CultureInfo culture,
975CultureInfo digitCulture,
MS\Internal\TextFormatting\NumberSubstitution.cs (23)
20internal CultureInfo DigitCulture
50internal static NumberSubstitutionMethod GetResolvedSubstitutionMethod(TextRunProperties properties, CultureInfo digitCulture, out bool ignoreUserOverride)
58CultureInfo numberCulture = GetNumberCulture(properties, out method, out ignoreUserOverride);
100CultureInfo numberCulture = GetNumberCulture(properties, out method, out ignoreUserOverride);
113private static CultureInfo GetNumberCulture(TextRunProperties properties, out NumberSubstitutionMethod method, out bool ignoreUserOverride)
132return CultureInfo.CurrentCulture;
141private CultureInfo GetDigitCulture(CultureInfo numberCulture, NumberSubstitutionMethod method, out bool contextual)
167CultureInfo digitCulture;
206private static bool HasLatinDigits(CultureInfo culture)
218private static bool IsArabic(CultureInfo culture)
223private static bool IsFarsi(CultureInfo culture)
234private CultureInfo GetTraditionalCulture(CultureInfo numberCulture)
259CultureInfo digitCulture = null;
477private CultureInfo CreateTraditionalCulture(CultureInfo numberCulture, int firstDigit, bool arabic)
484CultureInfo digitCulture = (CultureInfo)numberCulture.Clone();
527private CultureInfo _lastTraditionalCulture;
532private CultureInfo _lastNumberCulture;
534private CultureInfo _digitCulture;
548internal DigitMap(CultureInfo digitCulture)
System\Windows\Media\FormattedText.cs (11)
32CultureInfo culture,
62CultureInfo culture,
96CultureInfo culture,
128CultureInfo culture,
162CultureInfo culture,
187CultureInfo culture,
199private void InitFormattedText(string textToFormat, CultureInfo culture, FlowDirection flowDirection, Typeface typeface,
266private static void ValidateCulture(CultureInfo culture)
484public void SetCulture(CultureInfo culture)
495public void SetCulture(CultureInfo culture, int startIndex, int count)
1858CultureInfo culture = null;
System\Windows\Media\GlyphTypeface.cs (18)
306public IDictionary<CultureInfo,string> FamilyNames
334public IDictionary<CultureInfo, string> FaceNames
363public IDictionary<CultureInfo, string> Win32FamilyNames
385IDictionary<CultureInfo, string> adjustedFaceNames = _font.FaceNames;
388foreach (KeyValuePair<CultureInfo, string> pair in adjustedFaceNames)
405public IDictionary<CultureInfo, string> Win32FaceNames
421public IDictionary<CultureInfo, string> VersionStrings
434public IDictionary<CultureInfo, string> Copyrights
447public IDictionary<CultureInfo, string> ManufacturerNames
462public IDictionary<CultureInfo, string> Trademarks
475public IDictionary<CultureInfo, string> DesignerNames
489public IDictionary<CultureInfo, string> Descriptions
504public IDictionary<CultureInfo, string> VendorUrls
517public IDictionary<CultureInfo, string> DesignerUrls
532public IDictionary<CultureInfo, string> LicenseDescriptions
546public IDictionary<CultureInfo, string> SampleTexts
1378CultureInfo cultureInfo,
1628private IDictionary<CultureInfo, string> GetFontInfo(MS.Internal.Text.TextInterface.InformationalStringID informationalStringID)
PresentationCore.Tests (172)
System\Windows\DurationConverter.Tests.cs (9)
43public void ConvertTo_ReturnsExpected(string expected, CultureInfo? culture, object value, bool checkTimeSpan)
60yield return new object?[] { "17.22:10:15.4571230", CultureInfo.InvariantCulture, new Duration(new TimeSpan(17, 22, 10, 15, 457, 123)), true };
93public void ConvertFrom_ReturnsExpected(Duration expected, CultureInfo? culture, object value)
106yield return new object?[] { new Duration(TimeSpan.FromTicks(6488853448000)), CultureInfo.InvariantCulture, "07:12:14:45.3448 " };
109yield return new object?[] { new Duration(TimeSpan.FromTicks(5184000000000)), CultureInfo.InvariantCulture, " 6 " };
111yield return new object?[] { new Duration(TimeSpan.FromTicks(223200000000)), CultureInfo.InvariantCulture, " 6:12 " };
117public void ConvertFrom_ThrowsFormatException(CultureInfo? culture, object value)
133yield return new object?[] { CultureInfo.InvariantCulture, " 6:12:14:45,3448 " };
141public void ConvertFrom_NotSupportedException(CultureInfo? culture, object value)
System\Windows\Input\Command\KeyGestureConverter.Tests.cs (42)
78public void ConvertFrom_ReturnsExpected(KeyGesture expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, string value)
93yield return new object?[] { new KeyGesture(Key.None, ModifierKeys.None, validateGesture: false), null, CultureInfo.InvariantCulture, string.Empty };
96yield return new object?[] { new KeyGesture(Key.NumLock, ModifierKeys.Control), null, CultureInfo.InvariantCulture, "Ctrl+NumLock" };
97yield return new object?[] { new KeyGesture(Key.A, ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Alt+A" };
98yield return new object?[] { new KeyGesture(Key.Back, ModifierKeys.Windows, "Massive Test"), null, CultureInfo.InvariantCulture, "Windows+Backspace,Massive Test" };
99yield return new object?[] { new KeyGesture(Key.F1, ModifierKeys.Alt, "displayString"), null, CultureInfo.InvariantCulture, "Alt+F1,displayString" };
101yield return new object?[] { new KeyGesture(Key.Insert, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+Windows+Insert" };
102yield return new object?[] { new KeyGesture(Key.NumLock, ModifierKeys.Control | ModifierKeys.Windows), null, CultureInfo.InvariantCulture, "Ctrl+Windows+NumLock" };
103yield return new object?[] { new KeyGesture(Key.F21, ModifierKeys.Alt | ModifierKeys.Windows, "displayString"), null, CultureInfo.InvariantCulture, "Alt+Windows+F21,displayString" };
105yield return new object?[] { new KeyGesture(Key.F8, ModifierKeys.Alt | ModifierKeys.Control, "Two Modifiers"), null, CultureInfo.InvariantCulture, "Ctrl+Alt+F8,Two Modifiers" };
106yield return new object?[] { new KeyGesture(Key.A, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control, "Test String"), null, CultureInfo.InvariantCulture, "Ctrl+Alt+Windows+A,Test String" };
109yield return new object?[] { new KeyGesture(Key.A, ModifierKeys.Alt, "Accept+Plus"), null, CultureInfo.InvariantCulture, "Alt+A,Accept+Plus" };
110yield return new object?[] { new KeyGesture(Key.NumLock, ModifierKeys.Control), null, CultureInfo.InvariantCulture, " Ctrl + NumLock " };
111yield return new object?[] { new KeyGesture(Key.A, ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Alt+A " };
112yield return new object?[] { new KeyGesture(Key.Back, ModifierKeys.Windows, "Massive Test"), null, CultureInfo.InvariantCulture, "Windows+ Backspace, Massive Test" };
113yield return new object?[] { new KeyGesture(Key.F1, ModifierKeys.Alt, ",,,,,,,,displayString"), null, CultureInfo.InvariantCulture, "Alt+F1,,,,,,,,,displayString" };
115yield return new object?[] { new KeyGesture(Key.F24, ModifierKeys.Alt | ModifierKeys.Windows, ",,, displayString"), null, CultureInfo.InvariantCulture, " Alt+Windows+ F24 ,,,, displayString" };
116yield return new object?[] { new KeyGesture(Key.F8, ModifierKeys.Alt | ModifierKeys.Control, "Two,,, Modifiers"), null, CultureInfo.InvariantCulture, "Ctrl+Alt+F8,Two,,, Modifiers" };
117yield return new object?[] { new KeyGesture(Key.D8, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control, ",, Test String,"), null, CultureInfo.InvariantCulture, "Ctrl+Alt+Windows+8 ,,, Test String, " };
123public void ConvertFrom_ThrowsNotSupportedException(CultureInfo? cultureInfo, object value)
135yield return new object?[] { CultureInfo.InvariantCulture, "Z" };
137yield return new object?[] { CultureInfo.InvariantCulture, null };
139yield return new object?[] { CultureInfo.InvariantCulture, new MouseGesture(MouseAction.LeftClick, ModifierKeys.Control) };
140yield return new object?[] { CultureInfo.InvariantCulture, new KeyGesture(Key.V, ModifierKeys.Control) };
141yield return new object?[] { CultureInfo.InvariantCulture, ModifierKeys.Control };
142yield return new object?[] { CultureInfo.InvariantCulture, Key.V };
148public void ConvertTo_ReturnsExpected(string expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, object? value)
161yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, null };
164yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, new KeyGesture(Key.None, ModifierKeys.None, validateGesture: false) };
165yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, new KeyGesture(Key.None, ModifierKeys.Control, validateGesture: false) };
170yield return new object?[] { "Z", null, CultureInfo.InvariantCulture, new KeyGesture(Key.Z, ModifierKeys.None, validateGesture: false) };
171yield return new object?[] { "Ctrl+NumLock", null, CultureInfo.InvariantCulture, new KeyGesture(Key.NumLock, ModifierKeys.Control) };
172yield return new object?[] { "Alt+A", null, CultureInfo.InvariantCulture, new KeyGesture(Key.A, ModifierKeys.Alt) };
173yield return new object?[] { "Windows+Backspace,Massive Test", null, CultureInfo.InvariantCulture, new KeyGesture(Key.Back, ModifierKeys.Windows, "Massive Test") };
174yield return new object?[] { "Alt+F1,displayString", null, CultureInfo.InvariantCulture, new KeyGesture(Key.F1, ModifierKeys.Alt, "displayString") };
176yield return new object?[] { "Ctrl+Alt+Windows+Insert", null, CultureInfo.InvariantCulture, new KeyGesture(Key.Insert, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt) };
177yield return new object?[] { "Ctrl+Windows+NumLock", null, CultureInfo.InvariantCulture, new KeyGesture(Key.NumLock, ModifierKeys.Control | ModifierKeys.Windows) };
178yield return new object?[] { "Alt+Windows+F21,displayString", null, CultureInfo.InvariantCulture, new KeyGesture(Key.F21, ModifierKeys.Alt | ModifierKeys.Windows, "displayString") };
180yield return new object?[] { "Ctrl+Alt+F8,Two Modifiers", null, CultureInfo.InvariantCulture, new KeyGesture(Key.F8, ModifierKeys.Alt | ModifierKeys.Control, "Two Modifiers") };
181yield return new object?[] { "Ctrl+Alt+Windows+A,Test String", null, CultureInfo.InvariantCulture, new KeyGesture(Key.A, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control, "Test String") };
190Assert.Throws<ArgumentNullException>(() => converter.ConvertTo(null, CultureInfo.InvariantCulture, new KeyGesture(Key.C, ModifierKeys.Control), null));
199Assert.Throws<NotSupportedException>(() => converter.ConvertTo(null, CultureInfo.InvariantCulture, value, destinationType));
System\Windows\Input\Command\MouseGestureConverter.Tests.cs (33)
79public void ConvertFrom_ReturnsExpected(MouseGesture expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, string value)
93yield return new object?[] { new MouseGesture(MouseAction.None, ModifierKeys.None), null, CultureInfo.InvariantCulture, string.Empty };
95yield return new object?[] { new MouseGesture(MouseAction.None, ModifierKeys.Control), null, CultureInfo.InvariantCulture, "Ctrl+" };
96yield return new object?[] { new MouseGesture(MouseAction.LeftClick, ModifierKeys.Control), null, CultureInfo.InvariantCulture, "Ctrl+LeftClick" };
98yield return new object?[] { new MouseGesture(MouseAction.WheelClick, ModifierKeys.Shift), null, CultureInfo.InvariantCulture, "Shift+WheelClick" };
99yield return new object?[] { new MouseGesture(MouseAction.LeftDoubleClick, ModifierKeys.Windows), null, CultureInfo.InvariantCulture, "Windows+LeftDoubleClick" };
100yield return new object?[] { new MouseGesture(MouseAction.RightClick, ModifierKeys.Control | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+RightClick" };
101yield return new object?[] { new MouseGesture(MouseAction.RightDoubleClick, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+Windows+RightDoubleClick" };
104yield return new object?[] { new MouseGesture(MouseAction.None, ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Alt+ " };
105yield return new object?[] { new MouseGesture(MouseAction.LeftClick, ModifierKeys.None), null, CultureInfo.InvariantCulture, " LeftClick " };
106yield return new object?[] { new MouseGesture(MouseAction.None, ModifierKeys.None), null, CultureInfo.InvariantCulture, " " };
107yield return new object?[] { new MouseGesture(MouseAction.WheelClick, ModifierKeys.Shift), null, CultureInfo.InvariantCulture, "Shift +WheelClick" };
109yield return new object?[] { new MouseGesture(MouseAction.LeftDoubleClick, ModifierKeys.Windows), null, CultureInfo.InvariantCulture, "Windows+ LeftDoubleClick " };
110yield return new object?[] { new MouseGesture(MouseAction.RightClick, ModifierKeys.Control | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+ RightClick" };
116public void ConvertFrom_ThrowsNotSupportedException(CultureInfo? cultureInfo, object value)
128yield return new object?[] { CultureInfo.InvariantCulture, null };
130yield return new object?[] { CultureInfo.InvariantCulture, new MouseGesture(MouseAction.LeftClick, ModifierKeys.Control) };
131yield return new object?[] { CultureInfo.InvariantCulture, new KeyGesture(Key.V, ModifierKeys.Control) };
132yield return new object?[] { CultureInfo.InvariantCulture, ModifierKeys.Control };
133yield return new object?[] { CultureInfo.InvariantCulture, MouseAction.LeftDoubleClick };
134yield return new object?[] { CultureInfo.InvariantCulture, Key.V };
140public void ConvertTo_ReturnsExpected(string expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, object? value)
153yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, null };
156yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.None, ModifierKeys.None) };
157yield return new object?[] { "Alt+", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.None, ModifierKeys.Alt) };
160yield return new object?[] { "LeftClick", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.LeftClick) };
161yield return new object?[] { "Ctrl+LeftClick", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.LeftClick, ModifierKeys.Control) };
162yield return new object?[] { "Alt+RightClick", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.RightClick, ModifierKeys.Alt) };
163yield return new object?[] { "Windows+WheelClick", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.WheelClick, ModifierKeys.Windows) };
164yield return new object?[] { "Alt+RightDoubleClick", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.RightDoubleClick, ModifierKeys.Alt) };
167yield return new object?[] { "Ctrl+Alt+Windows+MiddleClick", null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.MiddleClick, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control) };
176Assert.Throws<ArgumentNullException>(() => converter.ConvertTo(null, CultureInfo.InvariantCulture, new MouseGesture(MouseAction.LeftClick, ModifierKeys.Control), null));
185Assert.Throws<NotSupportedException>(() => converter.ConvertTo(null, CultureInfo.InvariantCulture, value, destinationType));
System\Windows\Input\MouseActionConverter.Tests.cs (19)
71public void ConvertFrom_ReturnsExpected(MouseAction expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, string value)
83yield return new object?[] { MouseAction.None, null, CultureInfo.InvariantCulture, string.Empty };
84yield return new object?[] { MouseAction.None, null, CultureInfo.InvariantCulture, "None" };
87yield return new object?[] { MouseAction.None, null, CultureInfo.InvariantCulture, string.Empty };
89yield return new object?[] { MouseAction.RightClick, null, CultureInfo.InvariantCulture, "RightClick" };
90yield return new object?[] { MouseAction.MiddleClick, null, CultureInfo.InvariantCulture, "MiddleClick" };
92yield return new object?[] { MouseAction.LeftDoubleClick, null, CultureInfo.InvariantCulture, "LeftDoubleClick" };
93yield return new object?[] { MouseAction.RightDoubleClick, null, CultureInfo.InvariantCulture, "RightDoubleClick" };
94yield return new object?[] { MouseAction.MiddleDoubleClick, null, CultureInfo.InvariantCulture, "MiddleDoubleClick" };
97yield return new object?[] { MouseAction.None, null, CultureInfo.InvariantCulture, " " };
99yield return new object?[] { MouseAction.LeftClick, null, CultureInfo.InvariantCulture, " LeFTCliCK " };
100yield return new object?[] { MouseAction.WheelClick, null, CultureInfo.InvariantCulture, " WHEELCLICK" };
102yield return new object?[] { MouseAction.LeftDoubleClick, null, CultureInfo.InvariantCulture, " leftdoubleclick " };
103yield return new object?[] { MouseAction.RightClick, null, CultureInfo.InvariantCulture, " rightclick" };
124public void ConvertTo_ReturnsExpected(string expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, object? value)
137yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, MouseAction.None };
138yield return new object?[] { "LeftClick", null, CultureInfo.InvariantCulture, MouseAction.LeftClick };
140yield return new object?[] { "MiddleClick", null, CultureInfo.InvariantCulture, MouseAction.MiddleClick };
142yield return new object?[] { "LeftDoubleClick", null, CultureInfo.InvariantCulture, MouseAction.LeftDoubleClick };
System\Windows\Media\Animation\KeySplineConverter.Tests.cs (64)
46public void ConvertFrom_ValidValues_ReturnsExpected(string input, double x1, double y1, double x2, double y2, CultureInfo culture)
63yield return new object[] { "0.25,0.1,0.25,1", 0.25, 0.1, 0.25, 1.0, CultureInfo.InvariantCulture };
68yield return new object[] { "0.5,0.75,0.25,0.9", 0.5, 0.75, 0.25, 0.9, CultureInfo.InvariantCulture };
70yield return new object[] { "1,0,0,1", 1.0, 0.0, 0.0, 1.0, CultureInfo.InvariantCulture };
76public void ConvertFrom_KeySpline_ThrowsArgumentException(string input, CultureInfo cultureInfo)
88yield return new object[] { "0.3, 0.4, 77771.6, 0.7", CultureInfo.InvariantCulture };
89yield return new object[] { " 1.1, 0.4, 0.6, 0.7", CultureInfo.InvariantCulture };
90yield return new object[] { "040.3, 881.2, 0.6, 0.7", CultureInfo.InvariantCulture };
92yield return new object[] { "1.1, 1.2, 0.6, 0.7 ", CultureInfo.InvariantCulture };
93yield return new object[] { "1110.3, 1.4, 1.6, 0.7", CultureInfo.InvariantCulture };
94yield return new object[] { "8888.9, 0.4, 0.6, 1.2", CultureInfo.InvariantCulture };
95yield return new object[] { "0.3, 0.4, 1.7776, 1.2", CultureInfo.InvariantCulture };
96yield return new object[] { "1.3, 0.4, 0.66666, 1.2", CultureInfo.InvariantCulture };
97yield return new object[] { "0.3, 1.8, 40.6, 1.2", CultureInfo.InvariantCulture };
98yield return new object[] { "1.3, 1.8, 0.6, 0.7", CultureInfo.InvariantCulture };
99yield return new object[] { "90.3, 1.8, 0.6, 72.2", CultureInfo.InvariantCulture };
100yield return new object[] { "1.3, 0.4, 1.6, 25", CultureInfo.InvariantCulture };
101yield return new object[] { "2221.3, 1.4, 1.6, 2.2", CultureInfo.InvariantCulture };
102yield return new object[] { "0.3, 1.4, 110.6, 2.2", CultureInfo.InvariantCulture };
103yield return new object[] { "1.1, 0.4, 1.6, 2.2", CultureInfo.InvariantCulture };
105yield return new object[] { "1.3, 1.4, 0.6, 0.7", CultureInfo.InvariantCulture };
106yield return new object[] { "0.3, 0.4, 1.6, 2.7", CultureInfo.InvariantCulture };
107yield return new object[] { "1.3, 0.4, 1.6, 2.7", CultureInfo.InvariantCulture };
121Assert.Throws<FormatException>(() => converter.ConvertFrom(null, CultureInfo.InvariantCulture, input));
136Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(null, CultureInfo.InvariantCulture, input));
145Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(null, CultureInfo.InvariantCulture, null!));
150public void ConvertTo_String_ReturnsExpected(KeySpline keySpline, CultureInfo culture, string expected)
164CultureInfo.InvariantCulture, "0.25,0.1,0.25,1"
169CultureInfo.InvariantCulture, "0.5,0.75,0.25,0.9"
189CultureInfo.InvariantCulture, "0.12,0.34,0.56,0.78"
194CultureInfo.InvariantCulture, "0.9,0.1,0.3,0.7"
199CultureInfo.InvariantCulture, "0,0.5,1,0.5"
204CultureInfo.InvariantCulture, "0.15,0.35,0.85,0.95"
214CultureInfo.InvariantCulture, "0.33,0.67,0.25,0.75"
229CultureInfo.InvariantCulture, "0.1,0.9,0.9,0.1"
234CultureInfo.InvariantCulture, "0.05,0.95,0.95,100.05"
254CultureInfo.InvariantCulture, "0.99,0.01,0.5,0.5"
261public void ConvertTo_ObjectInput_ReturnsStringRepresentation(object input, Type destinationType, CultureInfo culture)
272yield return new object[] { string.Empty, typeof(string), CultureInfo.InvariantCulture };
275yield return new object[] { Colors.Red, typeof(string), CultureInfo.InvariantCulture };
276yield return new object[] { Brushes.Purple, typeof(string), CultureInfo.CurrentCulture };
277yield return new object[] { "This is given back", typeof(string), CultureInfo.InvariantCulture };
278yield return new object[] { " This too ", typeof(string), CultureInfo.InvariantCulture };
284public void ConvertTo_InvalidData_ThrowsNotSupportedException(object? input, Type? destinationType, CultureInfo? culture)
295yield return new object[] { new KeySpline(0.1, 0.2, 0.3, 0.4), typeof(int), CultureInfo.CurrentCulture };
296yield return new object[] { new KeySpline(0.5, 0.6, 0.7, 0.8), typeof(double), CultureInfo.InvariantCulture };
297yield return new object[] { new KeySpline(0.25, 0.25, 0.75, 0.75), typeof(object), CultureInfo.InvariantCulture };
298yield return new object[] { new KeySpline(1.0, 0.0, 0.0, 1.0), typeof(bool), CultureInfo.InvariantCulture };
299yield return new object[] { new KeySpline(0.33, 0.66, 0.66, 0.33), typeof(DateTime), CultureInfo.InvariantCulture };
300yield return new object[] { new KeySpline(0.5, 0.5, 0.5, 0.5), typeof(Guid), CultureInfo.CurrentCulture };
301yield return new object[] { new KeySpline(0.1, 0.2, 0.3, 0.4), typeof(Uri), CultureInfo.InvariantCulture };
302yield return new object[] { new KeySpline(0.6, 0.7, 0.8, 0.9), typeof(Array), CultureInfo.InvariantCulture };
303yield return new object[] { new KeySpline(0.2, 0.3, 0.4, 0.5), typeof(TimeSpan), CultureInfo.InvariantCulture };
304yield return new object[] { new KeySpline(0.7, 0.8, 0.9, 1.0), typeof(Enum), CultureInfo.InvariantCulture };
305yield return new object[] { new KeySpline(0.1, 0.2, 0.3, 0.4), typeof(Point), CultureInfo.InvariantCulture };
306yield return new object[] { new KeySpline(0.1, 0.1, 0.9, 0.9), typeof(Color), CultureInfo.CurrentCulture };
307yield return new object[] { new KeySpline(0.2, 0.4, 0.6, 0.8), typeof(KeySpline), CultureInfo.InvariantCulture };
308yield return new object[] { new KeySpline(0.2, 0.3, 0.4, 0.5), typeof(byte[]), CultureInfo.InvariantCulture };
309yield return new object[] { new KeySpline(0.0, 0.1, 0.2, 0.3), typeof(Dictionary<int, string>), CultureInfo.InvariantCulture };
310yield return new object[] { new KeySpline(0.1, 0.2, 0.3, 0.4), typeof(List<int>), CultureInfo.InvariantCulture };
311yield return new object[] { new KeySpline(0.4, 0.3, 0.2, 0.1), typeof(Stack<int>), CultureInfo.InvariantCulture };
317public void ConvertTo_InvalidDestinationType_ThrowsArgumentNullException(KeySpline? input, Type? destinationType, CultureInfo? culture)
328yield return new object?[] { null, null, CultureInfo.InvariantCulture };
329yield return new object?[] { new KeySpline(0.0, 0.0, 1.0, 1.0), null, CultureInfo.InvariantCulture };
System\Windows\TextDecorationCollectionConverter.Tests.cs (5)
41public void ConvertFrom_ReturnsExpected(TextDecorationCollection expected, CultureInfo cultureInfo, string text)
63yield return new object[] { new TextDecorationCollection(), CultureInfo.InvariantCulture, string.Empty };
64yield return new object[] { new TextDecorationCollection(), CultureInfo.InvariantCulture, " " };
65yield return new object[] { new TextDecorationCollection(), CultureInfo.InvariantCulture, "None" };
66yield return new object[] { new TextDecorationCollection(), CultureInfo.InvariantCulture, " None " };
PresentationFramework (540)
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (16)
211double height = Convert.ToDouble(node.Value, CultureInfo.InvariantCulture);
226double width = Convert.ToDouble(node.Value, CultureInfo.InvariantCulture);
241bool expanded = Convert.ToBoolean(node.Value, CultureInfo.InvariantCulture);
256((IAnnotationComponent)snc).ZOrder = Convert.ToInt32(node.Value, CultureInfo.InvariantCulture);
269double left = Convert.ToDouble(node.Value, CultureInfo.InvariantCulture);
289double top = Convert.ToDouble(node.Value, CultureInfo.InvariantCulture);
300snc.XOffset = Convert.ToDouble(node.Value, CultureInfo.InvariantCulture);
309snc.YOffset = Convert.ToDouble(node.Value, CultureInfo.InvariantCulture);
798sncAnnotation.UpdateAttribute(root, XmlToken.IsExpanded, expanded.ToString(CultureInfo.InvariantCulture));
806sncAnnotation.UpdateAttribute(root, XmlToken.Height, height.ToString(CultureInfo.InvariantCulture));
814sncAnnotation.UpdateAttribute(root, XmlToken.Width, width.ToString(CultureInfo.InvariantCulture));
831sncAnnotation.UpdateAttribute(root, XmlToken.Left, left.ToString(CultureInfo.InvariantCulture));
837sncAnnotation.UpdateAttribute(root, XmlToken.Top, snc.PositionTransform.Y.ToString(CultureInfo.InvariantCulture));
843sncAnnotation.UpdateAttribute(root, XmlToken.XOffset, snc.XOffset.ToString(CultureInfo.InvariantCulture));
849sncAnnotation.UpdateAttribute(root, XmlToken.YOffset, snc.YOffset.ToString(CultureInfo.InvariantCulture));
855sncAnnotation.UpdateAttribute(root, XmlToken.ZOrder, ((IAnnotationComponent)snc).ZOrder.ToString(CultureInfo.InvariantCulture));
MS\Internal\Data\DefaultValueConverter.cs (18)
194internal static object TryParse(object o, Type targetType, CultureInfo culture)
249protected object ConvertFrom(object o, Type destinationType, DependencyObject targetElement, CultureInfo culture)
254protected object ConvertTo(object o, Type destinationType, DependencyObject targetElement, CultureInfo culture)
274private object ConvertHelper(object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, bool isForward)
395public object Convert(object o, Type type, object parameter, CultureInfo culture)
400public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
430public object Convert(object o, Type type, object parameter, CultureInfo culture)
435public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
453public object Convert(object o, Type type, object parameter, CultureInfo culture)
458public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
567public object Convert(object o, Type type, object parameter, CultureInfo culture)
573public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
614public object Convert(object o, Type type, object parameter, CultureInfo culture)
631public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
657public object Convert(object o, Type type, object parameter, CultureInfo culture)
670public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
700public object Convert(object o, Type type, object parameter, CultureInfo culture)
705public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
MS\Internal\LayoutDump.cs (30)
43StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
104StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
340writer.WriteAttributeString("Count", count.ToString(CultureInfo.InvariantCulture));
364writer.WriteAttributeString("Count", uiElements.Count.ToString(CultureInfo.InvariantCulture));
381writer.WriteAttributeString("Left", point.X.ToString("F", CultureInfo.InvariantCulture));
382writer.WriteAttributeString("Top", point.Y.ToString("F", CultureInfo.InvariantCulture));
392writer.WriteAttributeString("Width", size.Width.ToString ("F", CultureInfo.InvariantCulture));
393writer.WriteAttributeString("Height", size.Height.ToString("F", CultureInfo.InvariantCulture));
403writer.WriteAttributeString("Left", rect.Left.ToString ("F", CultureInfo.InvariantCulture));
404writer.WriteAttributeString("Top", rect.Top.ToString ("F", CultureInfo.InvariantCulture));
405writer.WriteAttributeString("Width", rect.Width.ToString ("F", CultureInfo.InvariantCulture));
406writer.WriteAttributeString("Height", rect.Height.ToString("F", CultureInfo.InvariantCulture));
494writer.WriteAttributeString("BaselineOffset", ((double)text.GetValue(TextBlock.BaselineOffsetProperty)).ToString("F", CultureInfo.InvariantCulture));
583writer.WriteAttributeString("Count", flowDocumentPage.FormattedLinesCount.ToString(CultureInfo.InvariantCulture));
603writer.WriteAttributeString("Start", cpStart.ToString(CultureInfo.InvariantCulture));
604writer.WriteAttributeString("Length", (cpEnd - cpStart).ToString(CultureInfo.InvariantCulture));
617writer.WriteAttributeString("Start", cpStart.ToString(CultureInfo.InvariantCulture));
618writer.WriteAttributeString("Length", (cpEnd - cpStart).ToString(CultureInfo.InvariantCulture));
628writer.WriteAttributeString("Start", cpStart.ToString(CultureInfo.InvariantCulture));
629writer.WriteAttributeString("Length", (cpEnd - cpStart).ToString(CultureInfo.InvariantCulture));
632writer.WriteAttributeString("HiddenLength", (cpEnd - cpContentEnd).ToString(CultureInfo.InvariantCulture));
636writer.WriteAttributeString("EllipsesLength", (cpEnd - cpEllipses).ToString(CultureInfo.InvariantCulture));
650writer.WriteAttributeString("Count", lines.Count.ToString(CultureInfo.InvariantCulture));
691writer.WriteAttributeString("Count", paragraphs.Count.ToString(CultureInfo.InvariantCulture));
878writer.WriteAttributeString("Count", columns.Count.ToString(CultureInfo.InvariantCulture));
936writer.WriteAttributeString("Count", count.ToString(CultureInfo.InvariantCulture));
968writer.WriteAttributeString("ColumnIndex", columnIndex.ToString(CultureInfo.InvariantCulture));
976writer.WriteAttributeString("RowIndex", rowIndex.ToString(CultureInfo.InvariantCulture));
979writer.WriteAttributeString("ColumnSpan", cell.ColumnSpan.ToString(CultureInfo.InvariantCulture));
980writer.WriteAttributeString("RowSpan", cell.RowSpan.ToString(CultureInfo.InvariantCulture));
System\Windows\Automation\Peers\ScrollViewerAutomationPeer.cs (2)
153throw new ArgumentOutOfRangeException(nameof(horizontalPercent), SR.Format(SR.ScrollViewer_OutOfRange, "horizontalPercent", horizontalPercent.ToString(CultureInfo.InvariantCulture), "0", "100"));
157throw new ArgumentOutOfRangeException(nameof(verticalPercent), SR.Format(SR.ScrollViewer_OutOfRange, "verticalPercent", verticalPercent.ToString(CultureInfo.InvariantCulture), "0", "100"));
System\Windows\Controls\StickyNote.cs (4)
1866public object Convert(object o, Type type, object parameter, CultureInfo culture)
1882public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
1892public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
1910public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
System\Windows\Controls\VirtualizingStackPanel.cs (8)
12008if (int.TryParse(traceSplits[splitRegions[1]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int flushDepth))
12016if (int.TryParse(traceSplits[splitRegions[2]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int luThreshold))
12253return args.IsEmpty ? string.Empty : string.Format(CultureInfo.InvariantCulture, s_format[args.Length], args);
12790return string.Create(CultureInfo.InvariantCulture, $"{OpDepth} {VDepth} {ItemIndex} {Op} {Detail}");
12952return string.Create(CultureInfo.InvariantCulture, $"{_itemIndex} ds: {_desiredSize} ar: {_arrangeRect} in: {_inset}");
13029return string.Create(CultureInfo.InvariantCulture, $"{g.IndexFromContainer(container, returnLocalIndex:true)}");
13038return string.Create(CultureInfo.InvariantCulture, $"{localIndex}");
13042return string.Create(CultureInfo.InvariantCulture, $"{ContainerPath(parentContainer)}.{localIndex}");
System\Windows\Documents\RtfToXamlReader.cs (34)
185return px.ToString("f2", CultureInfo.InvariantCulture);
191return px.ToString("f2", CultureInfo.InvariantCulture);
197return px.ToString("f2", CultureInfo.InvariantCulture);
240d = double.Parse(s, provider: CultureInfo.InvariantCulture);
261i = int.Parse(s, provider: CultureInfo.InvariantCulture);
291i = System.Int32.Parse(s, System.Globalization.NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
478return nCount.ToString(CultureInfo.InvariantCulture);
581return sb.ToString().ToLower(CultureInfo.InvariantCulture);
647return sb.ToString().ToLower(CultureInfo.InvariantCulture);
1960CF < 0 ? string.Create(CultureInfo.InvariantCulture, stackalloc char[128], $"\\brdrs\\brdrw{EffectiveWidth}") :
1961string.Create(CultureInfo.InvariantCulture, stackalloc char[128], $"\\brdrs\\brdrw{EffectiveWidth}\\brdrcf{CF}");
2199sb.Append(BorderLeft.CF.ToString(CultureInfo.InvariantCulture));
2206sb.Append(BorderTop.CF.ToString(CultureInfo.InvariantCulture));
2213sb.Append(BorderRight.CF.ToString(CultureInfo.InvariantCulture));
2220sb.Append(BorderBottom.CF.ToString(CultureInfo.InvariantCulture));
2223sb.Append(Spacing.ToString(CultureInfo.InvariantCulture));
2661sb.Append(t.ToString(CultureInfo.InvariantCulture));
2663sb.Append(Width.Value.ToString(CultureInfo.InvariantCulture));
2665sb.Append(CellX.ToString(CultureInfo.InvariantCulture));
2736sb.Append(entry.Color.ToString(CultureInfo.InvariantCulture));
3648string mappedName = (string)map[entry.Name.ToLower(CultureInfo.InvariantCulture)];
3771string keyname = lhs_name.ToLower(CultureInfo.InvariantCulture);
4840sb.Append((fs / 2).ToString(CultureInfo.InvariantCulture));
4885CultureInfo ci = new CultureInfo((int)fsThis.LangCur);
4991xamlStringBuilder.Append(ic.ToString("x", CultureInfo.InvariantCulture));
5151xamlStringBuilder.Append(cToUse.ToString(CultureInfo.InvariantCulture));
5167xamlStringBuilder.Append(ColSpan.ToString(CultureInfo.InvariantCulture));
5173xamlStringBuilder.Append(RowSpan.ToString(CultureInfo.InvariantCulture));
5201xamlStringBuilder.Append(cToUse.ToString(CultureInfo.InvariantCulture));
5299xamlStringBuilder.Append(FormatState.StartIndex.ToString(CultureInfo.InvariantCulture));
8569d = double.Parse(ptString, provider: CultureInfo.InvariantCulture);
8695imageStringBuilder.Append(width.ToString(CultureInfo.InvariantCulture));
8709imageStringBuilder.Append(height.ToString(CultureInfo.InvariantCulture));
8717imageStringBuilder.Append(baselineOffset.ToString(CultureInfo.InvariantCulture));
System\Windows\Markup\BamlRecords.cs (15)
971return string.Create(CultureInfo.InvariantCulture, $"{RecordType}");
976string typeName = typeId.ToString(CultureInfo.InvariantCulture);
1911return string.Create(CultureInfo.InvariantCulture,
1989return string.Create(CultureInfo.InvariantCulture, $"{RecordType} nameId({NameId}) is '{Name}'");
2056return string.Create(CultureInfo.InvariantCulture, $"{RecordType} attr({_attributeId})");
2302return string.Create(CultureInfo.InvariantCulture, $"{RecordType} attr({_attributeId}) <== '{Value}'");
2439return string.Create(CultureInfo.InvariantCulture,
3292return string.Create(CultureInfo.InvariantCulture, $"{RecordType} typeId={GetTypeName(TypeId)}");
3680return string.Create(CultureInfo.InvariantCulture,
3755return string.Create(CultureInfo.InvariantCulture,
3833return string.Create(CultureInfo.InvariantCulture,
4927return string.Create(CultureInfo.InvariantCulture,
5035return string.Create(CultureInfo.InvariantCulture,
5189return string.Create(CultureInfo.InvariantCulture,
5250return string.Create(CultureInfo.InvariantCulture,
System\Windows\Navigation\JournalEntryListConverter.cs (4)
29public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
37public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
104public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
126public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
PresentationFramework.Aero (3)
PresentationFramework.Aero2 (3)
PresentationFramework.AeroLite (3)
PresentationFramework.Classic (3)
PresentationFramework.Fluent (6)
PresentationFramework.Luna (3)
PresentationFramework.Royale (3)
PresentationFramework.Tests (51)
System\Windows\Controls\VirtualizationCacheLengthConverter.Tests.cs (51)
53public void ConvertFrom_StringValues_ReturnsExpected(string input, double cacheBefore, double cacheAfter, CultureInfo cultureInfo)
71yield return new object[] { "25,50", 25.0, 50.0, CultureInfo.InvariantCulture };
72yield return new object[] { "100,200", 100.0, 200.0, CultureInfo.InvariantCulture };
73yield return new object[] { "12.34,56.78", 12.34, 56.78, CultureInfo.InvariantCulture };
74yield return new object[] { "0,0", 0.0, 0.0, CultureInfo.InvariantCulture, };
75yield return new object[] { "1,2", 1.0, 2.0, CultureInfo.InvariantCulture };
76yield return new object[] { "3.14,2.718", 3.14, 2.718, CultureInfo.InvariantCulture };
77yield return new object[] { "42,84", 42.0, 84.0, CultureInfo.InvariantCulture };
78yield return new object[] { "99.9,100.1", 99.9, 100.1, CultureInfo.InvariantCulture };
79yield return new object[] { "0.1,0.2", 0.1, 0.2, CultureInfo.InvariantCulture };
80yield return new object[] { "123,456", 123.0, 456.0, CultureInfo.InvariantCulture };
97yield return new object[] { "99.9 , 100.1 ", 99.9, 100.1, CultureInfo.InvariantCulture };
98yield return new object[] { " 0.1 ,0.2 ", 0.1, 0.2, CultureInfo.InvariantCulture };
103yield return new object[] { "15.25", 15.25, 15.25, CultureInfo.InvariantCulture };
109yield return new object[] { " 2.718 ", 2.718, 2.718, CultureInfo.InvariantCulture };
115public void ConvertFrom_NumericValues_ReturnsExpected<T>(T input, double expectedCache, CultureInfo cultureInfo)
132yield return new object[] { (decimal)25.3, 25.3, CultureInfo.InvariantCulture };
135yield return new object[] { (ushort)65535, 65535.0, CultureInfo.InvariantCulture };
145public void ConvertFrom_ThrowsNotSupportedException(CultureInfo? culture, object value)
164public void ConvertFrom_ThrowsInvalidCastException(CultureInfo? culture, object value)
180yield return new object?[] { CultureInfo.InvariantCulture, typeof(VirtualizationCacheLengthUnit) };
181yield return new object?[] { CultureInfo.InvariantCulture, typeof(VirtualizationCacheLengthConverter) };
187public void ConvertFrom_ThrowsFormatException(CultureInfo? culture, object value)
201yield return new object?[] { CultureInfo.InvariantCulture, "10,5;10,5" };
206yield return new object?[] { CultureInfo.InvariantCulture, "10,5.10,5" };
207yield return new object?[] { CultureInfo.InvariantCulture, "0.7, 0.5, 0.3" };
208yield return new object?[] { CultureInfo.InvariantCulture, "0.1, 0.2, 0.3" };
212yield return new object?[] { CultureInfo.InvariantCulture, string.Empty };
226Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(null, CultureInfo.InvariantCulture, input));
231public void ConvertTo_ReturnsExpected(string expected, VirtualizationCacheLength input, CultureInfo cultureInfo)
244yield return new object[] { "0,0", new VirtualizationCacheLength(0), CultureInfo.InvariantCulture };
255yield return new object[] { "12.34,56.78", new VirtualizationCacheLength(12.34, 56.78), CultureInfo.InvariantCulture };
264yield return new object[] { "-7.89,0", new VirtualizationCacheLength(-7.89, 0), CultureInfo.InvariantCulture };
270public void ConvertTo_InvalidData_ThrowsNotSupportedException(object? input, Type? destinationType, CultureInfo? culture)
282yield return new object[] { new VirtualizationCacheLength(666.666), typeof(Uri), CultureInfo.InvariantCulture };
283yield return new object[] { new VirtualizationCacheLength(255848), typeof(Array), CultureInfo.InvariantCulture };
284yield return new object[] { new VirtualizationCacheLength(0.3, 0.4), typeof(int), CultureInfo.CurrentCulture };
285yield return new object[] { new VirtualizationCacheLength(0.7, 0.8), typeof(double), CultureInfo.InvariantCulture };
286yield return new object[] { new VirtualizationCacheLength(0.75, 0.75), typeof(object), CultureInfo.InvariantCulture };
287yield return new object[] { new VirtualizationCacheLength(0.0, 1.0), typeof(bool), CultureInfo.InvariantCulture };
288yield return new object[] { new VirtualizationCacheLength(0.66, 0.33), typeof(DateTime), CultureInfo.InvariantCulture };
290yield return new object[] { new VirtualizationCacheLength(0.9, 1.0), typeof(Enum), CultureInfo.InvariantCulture };
291yield return new object[] { new VirtualizationCacheLength(0.3, 0.4), typeof(Point), CultureInfo.InvariantCulture };
292yield return new object[] { new VirtualizationCacheLength(0.9, 0.9), typeof(VirtualizationCacheLength), CultureInfo.CurrentCulture };
294yield return new object[] { new VirtualizationCacheLength(0.4, 0.5), typeof(byte[]), CultureInfo.InvariantCulture };
295yield return new object[] { new VirtualizationCacheLength(0.2, 0.3), typeof(Dictionary<int, string>), CultureInfo.InvariantCulture };
296yield return new object[] { new VirtualizationCacheLength(0.3, 0.4), typeof(List<int>), CultureInfo.InvariantCulture };
297yield return new object[] { new VirtualizationCacheLength(0.2, 0.1), typeof(Stack<int>), CultureInfo.InvariantCulture };
303public void ConvertTo_InvalidDestinationType_ThrowsArgumentNullException(VirtualizationCacheLength? input, Type? destinationType, CultureInfo? culture)
314yield return new object?[] { null, null, CultureInfo.InvariantCulture };
315yield return new object?[] { new VirtualizationCacheLength(0.0, 0.0), null, CultureInfo.InvariantCulture };
PresentationFramework-SystemData (3)
PresentationFramework-SystemXml (4)
PresentationUI (38)
RazorPagesWebSite (1)
RazorWebSite (6)
ReachFramework (110)
PrintConfig\PrtTicket_Public_Simple.cs (5)
110return ((PageMediaSizeName != null) ? String.Format(CultureInfo.CurrentCulture, "{0}", PageMediaSizeName) : "Null") + " (" +
111((Width != null) ? String.Format(CultureInfo.CurrentCulture, "{0}", Width) : "Null") +
113((Height != null) ? String.Format(CultureInfo.CurrentCulture, "{0}", Height) : "Null") +
218return ((X != null) ? String.Format(CultureInfo.CurrentCulture, "{0}", X) : "Null") +
220((Y != null) ? String.Format(CultureInfo.CurrentCulture, "{0}", Y) : "Null") +
Serialization\VisualSerializer.cs (15)
129rslt.Append(v.ToString(CultureInfo.InvariantCulture));
133rslt.Append(v.ToString(_coordFormat, CultureInfo.InvariantCulture));
192rslt.Append(CheckFloat(d).ToString(CultureInfo.InvariantCulture));
227rslt.Append(d.ToString(CultureInfo.InvariantCulture));
235rslt.Append(Convert.ToString(obj, CultureInfo.InvariantCulture));
326colorString = converter.ConvertTo(_context, CultureInfo.InvariantCulture, color, typeof(string)) as string;
558WriteAttr("Viewbox", vb.ToString(CultureInfo.InvariantCulture));
559WriteAttr("Viewport", vp.ToString(CultureInfo.InvariantCulture));
674StringWriter swriter = new StringWriter(CultureInfo.InvariantCulture);
982rslt.Append(CheckFloat(mat.M11).ToString(CultureInfo.InvariantCulture)); rslt.Append(',');
983rslt.Append(CheckFloat(mat.M12).ToString(CultureInfo.InvariantCulture)); rslt.Append(',');
984rslt.Append(CheckFloat(mat.M21).ToString(CultureInfo.InvariantCulture)); rslt.Append(',');
985rslt.Append(CheckFloat(mat.M22).ToString(CultureInfo.InvariantCulture)); rslt.Append(',');
986rslt.Append(CheckFloat(mat.OffsetX).ToString(CultureInfo.InvariantCulture)); rslt.Append(',');
987rslt.Append(CheckFloat(mat.OffsetY).ToString(CultureInfo.InvariantCulture));
ResultsOfTGenerator (3)
Roslyn.Diagnostics.Analyzers (5)
Roslyn.Diagnostics.CSharp.Analyzers (7)
Roslyn.Diagnostics.VisualBasic.Analyzers (8)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (2)
RoutingWebSite (1)
ServerComparison.FunctionalTests (1)
Shared (7)
Shared.Tests (2)
SignalR.Client.FunctionalTestApp (2)
SocialSample (2)
Sockets.BindTests (2)
Sockets.FunctionalTests (3)
StatusCodePagesSample (5)
Startup.cs (5)
38context.Response.StatusCode = int.Parse(requestedStatusCode, CultureInfo.InvariantCulture);
89builder.AppendFormat(CultureInfo.InvariantCulture, "<br><b>{0}{1}{2}</b><br>", "Status Code", space, "Status Code Pages");
93CultureInfo.InvariantCulture,
97string.Format(CultureInfo.InvariantCulture, "<a href=\"?statuscode={0}\">[Enabled]</a>{1}", statusCode, space),
98string.Format(CultureInfo.InvariantCulture, "<a href=\"?statuscode={0}&disableStatusCodePages=true\">[Disabled]</a>{1}", statusCode, space));
Stress.ApiService (1)
Stress.AppHost (2)
Swaggatherer (12)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
System.CodeDom (36)
System\CodeDom\Compiler\CompilerError.cs (2)
34string.Format(CultureInfo.InvariantCulture, "{0}({1},{2}) : {3} {4}: {5}", FileName, Line, Column, WarningString, ErrorNumber, ErrorText) :
35string.Format(CultureInfo.InvariantCulture, "{0} {1}: {2}", WarningString, ErrorNumber, ErrorText);
System.Collections.Concurrent (2)
System.Collections.NonGeneric (9)
System.Collections.Specialized (1)
System.ComponentModel.Annotations (16)
System\ComponentModel\DataAnnotations\RangeAttribute.cs (4)
179return string.Format(CultureInfo.CurrentCulture, ErrorMessageString, name, Minimum, Maximum);
206Initialize((int)minimum, (int)maximum, v => Convert.ToInt32(v, CultureInfo.InvariantCulture));
211v => Convert.ToDouble(v, CultureInfo.InvariantCulture));
241: converter.ConvertFrom(null, CultureInfo.InvariantCulture, value);
System.ComponentModel.Composition (15)
System.ComponentModel.Composition.Registration (1)
System.ComponentModel.TypeConverter (146)
System\ComponentModel\ComponentResourceManager.cs (10)
20private Dictionary<CultureInfo, SortedList<string, object?>?>? _resourceSets;
21private CultureInfo? _neutralResourcesCulture;
35private CultureInfo? NeutralResourcesCulture
66public virtual void ApplyResources(object value, string objectName, CultureInfo? culture)
80public virtual void ApplyResourcesToRegisteredType(object value, string objectName, CultureInfo? culture)
90private void ApplyResources(object value, Type typeFromValue, string objectName, CultureInfo? culture)
92culture ??= CultureInfo.CurrentUICulture;
109_resourceSets = new Dictionary<CultureInfo, SortedList<string, object?>?>();
215private SortedList<string, object?> FillResources(CultureInfo culture, out ResourceSet? resourceSet)
222if (!culture.Equals(CultureInfo.InvariantCulture) && !culture.Equals(NeutralResourcesCulture))
System\ComponentModel\MaskedTextProvider.cs (12)
93CultureInfo.InvariantCulture,
174public MaskedTextProvider(string mask, CultureInfo? culture)
185public MaskedTextProvider(string mask, CultureInfo? culture, bool restrictToAscii)
205public MaskedTextProvider(string mask, CultureInfo? culture, char passwordChar, bool allowPromptAsInput)
219public MaskedTextProvider(string mask, CultureInfo? culture, bool allowPromptAsInput, char promptChar, char passwordChar, bool restrictToAscii)
231culture ??= CultureInfo.CurrentCulture;
245foreach (CultureInfo tempCulture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
255Culture ??= CultureInfo.InvariantCulture;
264Culture = CultureInfo.ReadOnly(Culture);
512public CultureInfo Culture { get; }
794throw new IndexOutOfRangeException(index.ToString(CultureInfo.CurrentCulture));
System\ComponentModel\TypeConverter.cs (14)
49public object? ConvertFrom(object value) => ConvertFrom(null, CultureInfo.CurrentCulture, value);
54public virtual object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
68return ConvertFromString(null, CultureInfo.InvariantCulture, text);
76return ConvertFromString(context, CultureInfo.InvariantCulture, text);
89return ConvertFrom(context, CultureInfo.CurrentCulture, text);
95public object? ConvertFromString(ITypeDescriptorContext? context, CultureInfo? culture, string text)
113public virtual object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
124if (culture != null && culture != CultureInfo.CurrentCulture)
141return ConvertToString(null, CultureInfo.InvariantCulture, value);
149return ConvertToString(context, CultureInfo.InvariantCulture, value);
157return (string?)ConvertTo(null, CultureInfo.CurrentCulture, value, typeof(string));
165return (string?)ConvertTo(context, CultureInfo.CurrentCulture, value, typeof(string));
171public string? ConvertToString(ITypeDescriptorContext? context, CultureInfo? culture, object? value)
317ConvertFrom(context, CultureInfo.InvariantCulture, value!);
System.Composition.Convention (1)
System.Configuration.ConfigurationManager (54)
System\Configuration\MgmtConfigurationRecord.cs (8)
1933utilWriter.Write(string.Format(CultureInfo.InvariantCulture,
1940utilWriter.Write(string.Format(CultureInfo.InvariantCulture,
2050utilWriter.Write(string.Format(CultureInfo.InvariantCulture, FormatLocationNoPath,
2056utilWriter.Write(string.Format(CultureInfo.InvariantCulture, FormatLocationPath,
2087utilWriter.Write(string.Format(CultureInfo.InvariantCulture, FormatLocationPath,
2222CultureInfo.InvariantCulture, FormatConfigurationNamespace,
2962updatedXml = string.Format(CultureInfo.InvariantCulture, FormatSectionConfigSource,
3140utilWriter.Write(string.Format(CultureInfo.InvariantCulture, FormatConfigSourceFile,
System.Data.Common (185)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (12)
276return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name);
320return IndexOutOfRange(SR.Format(SR.ADP_CollectionIndexInt32, index.ToString(CultureInfo.InvariantCulture), collection.Name, count.ToString(CultureInfo.InvariantCulture)));
460return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidSourceBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), srcOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
464return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidDestinationBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), dstOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
468return IndexOutOfRange(SR.Format(SR.SQL_InvalidBufferSizeOrIndex, numBytes.ToString(CultureInfo.InvariantCulture), bufferIndex.ToString(CultureInfo.InvariantCulture)));
472return IndexOutOfRange(SR.Format(SR.SQL_InvalidDataLength, length.ToString(CultureInfo.InvariantCulture)));
4760 == CultureInfo.InvariantCulture.CompareInfo.Compare(strvalue, strconst, CompareOptions.IgnoreCase);
478internal static int DstCompare(string strA, string strB) => CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, ADP.DefaultCompareOptions);
System\Data\Common\DBSchemaRow.cs (16)
74return Convert.ToString(value, CultureInfo.InvariantCulture)!;
88return Convert.ToInt32(value, CultureInfo.InvariantCulture);
103return Convert.ToString(value, CultureInfo.InvariantCulture)!;
119return Convert.ToString(value, CultureInfo.InvariantCulture)!;
136return Convert.ToString(value, CultureInfo.InvariantCulture)!;
152return Convert.ToString(value, CultureInfo.InvariantCulture)!;
168return Convert.ToString(value, CultureInfo.InvariantCulture)!;
184return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
200return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
216return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
232return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
248return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
264return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
280return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
296return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
329return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
System\Data\DataException.cs (14)
403public static Exception ColumnOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataColumns_OutOfRange, (index).ToString(CultureInfo.InvariantCulture)));
418public static Exception InvalidOrdinal(string name, int ordinal) => _ArgumentOutOfRange(name, SR.Format(SR.DataColumn_OrdinalExceedMaximum, (ordinal).ToString(CultureInfo.InvariantCulture)));
457public static Exception ConstraintOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataConstraint_OutOfRange, (index).ToString(CultureInfo.InvariantCulture)));
506public static Exception CannotSetMaxLength(DataColumn column, int value) => _Argument(SR.Format(SR.DataColumn_CannotSetMaxLength, column.ColumnName, value.ToString(CultureInfo.InvariantCulture)));
542public static Exception GetElementIndex(int index) => _IndexOutOfRange(SR.Format(SR.DataView_GetElementIndex, (index).ToString(CultureInfo.InvariantCulture)));
556public static Exception KeyTooManyColumns(int cols) => _InvalidConstraint(SR.Format(SR.DataKey_TooManyColumns, (cols).ToString(CultureInfo.InvariantCulture)));
604public static Exception RowOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataRow_OutOfRange, (index).ToString(CultureInfo.InvariantCulture)));
605public static Exception RowInsertOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataRow_RowInsertOutOfRange, (index).ToString(CultureInfo.InvariantCulture)));
606public static Exception RowInsertTwice(int index, string tableName) => _IndexOutOfRange(SR.Format(SR.DataRow_RowInsertTwice, (index).ToString(CultureInfo.InvariantCulture), tableName));
629_Argument(SR.Format(SR.DataIndex_KeyLength, (length).ToString(CultureInfo.InvariantCulture), (keyLength).ToString(CultureInfo.InvariantCulture)));
666public static Exception TableOutOfRange(int index) => _IndexOutOfRange(SR.Format(SR.DataTable_OutOfRange, (index).ToString(CultureInfo.InvariantCulture)));
682public static Exception RangeArgument(int min, int max) => _Argument(SR.Format(SR.Range_Argument, (min).ToString(CultureInfo.InvariantCulture), (max).ToString(CultureInfo.InvariantCulture)));
System\Data\DataTable.cs (19)
78private CultureInfo _culture;
171_culture = CultureInfo.CurrentCulture;
203bool isSingleTable = context.Context != null ? Convert.ToBoolean(context.Context, CultureInfo.InvariantCulture) : true;
234bool isSingleTable = context.Context != null ? Convert.ToBoolean(context.Context, CultureInfo.InvariantCulture) : true;
381IFormatProvider formatProvider = CultureInfo.InvariantCulture;
437CultureInfo culture = new CultureInfo(lcid);
457IFormatProvider formatProvider = CultureInfo.InvariantCulture;
585info.AddValue(string.Format(CultureInfo.InvariantCulture, "DataTable_{0}.Constraints", serIndex), constraintList);
594ArrayList constraintList = (ArrayList)info.GetValue(string.Format(CultureInfo.InvariantCulture, "DataTable_{0}.Constraints", serIndex), typeof(ArrayList))!;
668info.AddValue(string.Format(CultureInfo.InvariantCulture, "DataTable_{0}.DataColumn_{1}.Expression", serIndex, i), Columns[i].Expression);
679string expr = info.GetString(string.Format(CultureInfo.InvariantCulture, "DataTable_{0}.DataColumn_{1}.Expression", serIndex, i))!;
762IFormatProvider formatProvider = CultureInfo.InvariantCulture;
784IFormatProvider formatProvider = CultureInfo.InvariantCulture;
1368CultureInfo culture = Locale;
1371culture = CultureInfo.InvariantCulture;
1404public CultureInfo Locale
1428CultureInfo oldLocale = _culture;
1478internal bool SetLocaleValue(CultureInfo culture, bool userSet, bool resetIndexes)
1780CultureInfo currentLocale = Locale;
System\Data\Filter\FilterException.cs (4)
158return _Syntax(SR.Format(SR.Expr_UnknownToken, token, position.ToString(CultureInfo.InvariantCulture)));
163return _Syntax(SR.Format(SR.Expr_UnknownToken1, tokExpected.ToString(), tokCurr.ToString(), position.ToString(CultureInfo.InvariantCulture)));
218return _Eval(SR.Format(SR.Expr_ArgumentType, function, arg.ToString(CultureInfo.InvariantCulture), type));
223return _Eval(SR.Format(SR.Expr_ArgumentTypeInteger, function, arg.ToString(CultureInfo.InvariantCulture)));
System\Data\xmlsaver.cs (20)
80s = Convert.ToString(entry.Key, CultureInfo.InvariantCulture)!;
89v = (string)BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)entry.Value, typeof(string), CultureInfo.InvariantCulture);
93v = Convert.ToString(entry.Value, CultureInfo.InvariantCulture)!;
153type != typeof(CultureInfo) &&
723el.SetAttribute(Keywords.MINOCCURS, top[i].MinOccurs.ToString(CultureInfo.InvariantCulture));
731el.SetAttribute(Keywords.MAXOCCURS, top[i].MaxOccurs.ToString(CultureInfo.InvariantCulture));
828rootSchema.SetAttribute(Keywords.MSD_FRAGMENTCOUNT, Keywords.MSDNS, _namespaces.Count.ToString(CultureInfo.InvariantCulture));
1034if (dataSet.ShouldSerializeLocale() || !dataSet.Locale.Equals(CultureInfo.CurrentCulture))
1056if (dt.ShouldSerializeLocale() || !dt.Locale.Equals(CultureInfo.CurrentCulture))
1231string prefix = Keywords.APP + Convert.ToString(++_prefixCount, CultureInfo.InvariantCulture);
1375root.SetAttribute("AutoIncrementSeed", Keywords.MSDNS, col.AutoIncrementSeed.ToString(CultureInfo.InvariantCulture));
1378root.SetAttribute("AutoIncrementStep", Keywords.MSDNS, col.AutoIncrementStep.ToString(CultureInfo.InvariantCulture));
1540root.SetAttribute(Keywords.MINOCCURS, minOccurs.ToString(CultureInfo.InvariantCulture));
1543root.SetAttribute(Keywords.MSD_ORDINAL, Keywords.MSDNS, col.Ordinal.ToString(CultureInfo.InvariantCulture));
1887sc.SetAttribute(Keywords.MSD_ORDINAL, Keywords.MSDNS, colTxt.Ordinal.ToString(CultureInfo.InvariantCulture));
2450_xmlw.WriteAttributeString(Keywords.DFF, Keywords.DIFFID, Keywords.DFFNS, row.Table.TableName + row.rowID.ToString(CultureInfo.InvariantCulture));
2475_xmlw.WriteAttributeString(Keywords.DFF, Keywords.DIFFID, Keywords.DFFNS, row.Table.TableName + row.rowID.ToString(CultureInfo.InvariantCulture));
2508string rowIDString = table.TableName + row.rowID.ToString(CultureInfo.InvariantCulture);
2515parentId = parentRow.Table.TableName + parentRow.rowID.ToString(CultureInfo.InvariantCulture);
2951_xmlw.WriteAttributeString(Keywords.DFF, Keywords.DIFFID, Keywords.DFFNS, row.Table.TableName + row.rowID.ToString(CultureInfo.InvariantCulture));
System.Data.Odbc (44)
Common\System\Data\Common\AdapterUtil.Odbc.cs (7)
285return InvalidOperation(SR.GetString(SR.ADP_NonSeqByteAccess, badIndex.ToString(CultureInfo.InvariantCulture), currIndex.ToString(CultureInfo.InvariantCulture), method));
298return Argument(SR.GetString(SR.ADP_InvalidCommandTimeout, value.ToString(CultureInfo.InvariantCulture)), ADP.CommandTimeout);
306return InvalidOperation(SR.GetString(SR.ADP_UninitializedParameterSize, index.ToString(CultureInfo.InvariantCulture), dataType.Name));
378return Argument(SR.GetString(SR.ADP_UnknownDataTypeCode, ((int)typeCode).ToString(CultureInfo.InvariantCulture), dataType.FullName!));
382return Argument(SR.GetString(SR.ADP_InvalidOffsetValue, value.ToString(CultureInfo.InvariantCulture)));
386return Argument(SR.GetString(SR.ADP_InvalidSizeValue, value.ToString(CultureInfo.InvariantCulture)));
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (12)
276return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name);
320return IndexOutOfRange(SR.Format(SR.ADP_CollectionIndexInt32, index.ToString(CultureInfo.InvariantCulture), collection.Name, count.ToString(CultureInfo.InvariantCulture)));
460return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidSourceBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), srcOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
464return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidDestinationBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), dstOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
468return IndexOutOfRange(SR.Format(SR.SQL_InvalidBufferSizeOrIndex, numBytes.ToString(CultureInfo.InvariantCulture), bufferIndex.ToString(CultureInfo.InvariantCulture)));
472return IndexOutOfRange(SR.Format(SR.SQL_InvalidDataLength, length.ToString(CultureInfo.InvariantCulture)));
4760 == CultureInfo.InvariantCulture.CompareInfo.Compare(strvalue, strconst, CompareOptions.IgnoreCase);
478internal static int DstCompare(string strA, string strB) => CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, ADP.DefaultCompareOptions);
System.Diagnostics.DiagnosticSource (12)
System\Diagnostics\Metrics\MetricsEventSource.cs (9)
781if (!int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out int s) || s < -11 || s > 20)
797if (!int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out int m) || m < 2)
839rateStats.Delta.HasValue ? rateStats.Delta.Value.ToString(CultureInfo.InvariantCulture) : "", rateStats.Value.ToString(CultureInfo.InvariantCulture), instrumentId);
844rateStats.Delta.HasValue ? rateStats.Delta.Value.ToString(CultureInfo.InvariantCulture) : "", rateStats.Value.ToString(CultureInfo.InvariantCulture), instrumentId);
850lastValueStats.LastValue.HasValue ? lastValueStats.LastValue.Value.ToString(CultureInfo.InvariantCulture) : "", instrumentId);
855synchronousLastValueStats.LastValue.ToString(CultureInfo.InvariantCulture), instrumentId);
905sb.Append(CultureInfo.InvariantCulture, $"{quantiles[i].Quantile}={quantiles[i].Value}");
System.Diagnostics.EventLog (2)
System.Diagnostics.TextWriterTraceListener (8)
System.Diagnostics.TraceSource (4)
System.Drawing.Common.Tests (117)
System\Drawing\IconConverterTests.cs (34)
107Icon newIcon = (Icon)_icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, _iconBytes);
113Assert.Throws<NotSupportedException>(() => _icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
114Assert.Throws<NotSupportedException>(() => _icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
115Assert.Throws<NotSupportedException>(() => _icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
116Assert.Throws<NotSupportedException>(() => _icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
117Assert.Throws<NotSupportedException>(() => _icoConv.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
119newIcon = (Icon)_icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, _iconBytes);
125Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
126Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
127Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
128Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
129Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
135Assert.Equal(_iconStr, (string)_icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(string)));
138byte[] newIconBytes = (byte[])_icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _iconBytes.GetType());
144Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Rectangle)));
145Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _icon.GetType()));
146Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Size)));
147Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Point)));
148Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Metafile)));
149Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(object)));
150Assert.Throws<NotSupportedException>(() => _icoConv.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(int)));
152Assert.Equal(_iconStr, (string)_icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(string)));
155newIconBytes = (byte[])_icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _iconBytes.GetType());
161Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Rectangle)));
162Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, _icon.GetType()));
163Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Size)));
164Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Point)));
165Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(Metafile)));
166Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(object)));
167Assert.Throws<NotSupportedException>(() => _icoConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _icon, typeof(int)));
169using (new ThreadCultureChange(CultureInfo.CreateSpecificCulture("fr-FR"), CultureInfo.InvariantCulture))
172Assert.Equal("(none)", (string)_icoConv.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string)));
175Assert.Equal("(none)", (string)_icoConvFrmTD.ConvertTo(null, CultureInfo.CreateSpecificCulture("de-DE"), null, typeof(string)));
System\Drawing\ImageConverterTests.cs (36)
125Image newImage = (Image)_imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, _imageBytes);
130newImage = (Image)_imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, _imageBytes);
140Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
141Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
142Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
143Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
144Assert.Throws<NotSupportedException>(() => _imgConv.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
147Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
148Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new Bitmap(20, 20)));
149Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new Point(10, 10)));
150Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new SizeF(10, 10)));
151Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
157Assert.Equal(_imageStr, (string)_imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(string)));
159Assert.Equal(_imageStr, (string)_imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(string)));
162using (new ThreadCultureChange(CultureInfo.CreateSpecificCulture("fr-FR"), CultureInfo.InvariantCulture))
165Assert.Equal("(none)", (string)_imgConv.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string)));
168Assert.Equal("(none)", (string)_imgConvFrmTD.ConvertTo(null, CultureInfo.CreateSpecificCulture("de-DE"), null, typeof(string)));
175byte[] newImageBytes = (byte[])_imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, _imageBytes.GetType());
178newImageBytes = (byte[])_imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, _imageBytes.GetType());
197Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Rectangle)));
198Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, _image.GetType()));
199Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Size)));
200Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Bitmap)));
201Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Point)));
202Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Metafile)));
203Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(object)));
204Assert.Throws<NotSupportedException>(() => _imgConv.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(int)));
206Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Rectangle)));
207Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, _image.GetType()));
208Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Size)));
209Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Bitmap)));
210Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Point)));
211Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(Metafile)));
212Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(object)));
213Assert.Throws<NotSupportedException>(() => _imgConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _image, typeof(int)));
System\Drawing\ImageFormatConverterTests.cs (25)
65Assert.Equal(_imageFmt, (ImageFormat)_imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.ToString()));
66Assert.Equal(_imageFmt, (ImageFormat)_imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.ToString()));
72Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp));
73Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.Guid));
74Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
75Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture, 10));
77Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp));
78Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, ImageFormat.Bmp.Guid));
79Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, new object()));
80Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, 10));
85return (ImageFormat)_imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, imgFormatName);
119Assert.Throws<FormatException>(() => _imgFmtConv.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
123Assert.Throws<FormatException>(() => _imgFmtConvFrmTD.ConvertFrom(null, CultureInfo.InvariantCulture, "System.Drawing.String"));
130Assert.Equal(_imageFmtStr, (string)_imgFmtConv.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(string)));
133Assert.Equal(_imageFmtStr, (string)_imgFmtConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(string)));
137Assert.Equal(string.Empty, (string)_imgFmtConv.ConvertTo(null, CultureInfo.CreateSpecificCulture("ru-RU"), null, typeof(string)));
140Assert.Equal(string.Empty, (string)_imgFmtConvFrmTD.ConvertTo(null, CultureInfo.CreateSpecificCulture("de-DE"), null, typeof(string)));
146Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(ImageFormat)));
147Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(Guid)));
148Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(object)));
149Assert.Throws<NotSupportedException>(() => _imgFmtConv.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(int)));
151Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(ImageFormat)));
152Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(Guid)));
153Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(object)));
154Assert.Throws<NotSupportedException>(() => _imgFmtConvFrmTD.ConvertTo(null, CultureInfo.InvariantCulture, _imageFmt, typeof(int)));
System.Drawing.Primitives (3)
System.Formats.Cbor (3)
System.Formats.Nrbf (1)
System.Formats.Tar (4)
System.Globalization (1)
System.IO.Packaging (2)
System.Linq.Expressions (9)
System.Net.HttpListener (10)
System.Net.Mail (6)
System\Net\Mime\SmtpDateTime.cs (5)
167string.Create(CultureInfo.InvariantCulture, $"{_date:ddd, dd MMM yyyy HH:mm:ss} {(_unknownTimeZone ? UnknownTimeZoneDefaultOffset : UtcDefaultTimeZoneOffset)}") :
168string.Create(CultureInfo.InvariantCulture, $"{_date:ddd, dd MMM yyyy HH:mm:ss} {(timeZone.Ticks > 0 ? '+' : '-')}{timeZone:hhmm}");
188if (!int.TryParse(offset.AsSpan(1, 2), NumberStyles.None, CultureInfo.InvariantCulture, out hours))
193if (!int.TryParse(offset.AsSpan(3, 2), NumberStyles.None, CultureInfo.InvariantCulture, out minutes))
262if (!DateTime.TryParseExact(date, s_validDateTimeFormats, CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, out dateValue))
System.Net.Ping (1)
System.Net.Security (1)
System.Net.ServerSentEvents (2)
System.Net.WebSockets.Client (3)
System.Private.CoreLib (436)
src\libraries\System.Private.CoreLib\src\System\Activator.cs (2)
25public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture) =>
52public static ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture, object?[]? activationAttributes)
src\libraries\System.Private.CoreLib\src\System\Activator.RuntimeType.cs (3)
21public static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture, object?[]? activationAttributes)
60public static ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture, object?[]? activationAttributes)
113CultureInfo? culture,
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (4)
295public ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
325public object? CreateInstanceAndUnwrap(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
352public ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
378public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (7)
3389if (manifest.GetLocalizedMessage(eventKey, CultureInfo.CurrentUICulture, etwFormat: false) is string msg)
5810CultureInfo ci = CultureInfo.CurrentUICulture;
5841if (resources.GetString(key, CultureInfo.InvariantCulture) is string localizedString)
5859internal string? GetLocalizedMessage(string key, CultureInfo ci, bool etwFormat)
5921eventMessage ??= resources.GetString("event_" + eventName, CultureInfo.InvariantCulture);
5997ManifestError(SR.Format(SR.EventSource_UndefinedKeyword, "0x" + bit.ToString("x", CultureInfo.CurrentCulture), eventName), true);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (14)
33internal static readonly CompareInfo Invariant = CultureInfo.InvariantCulture.CompareInfo;
53internal CompareInfo(CultureInfo culture)
106return CultureInfo.GetCultureInfo(culture).CompareInfo;
116return CultureInfo.GetCultureInfo(name).CompareInfo;
170private void InitSort(CultureInfo culture)
209m_name = CultureInfo.GetCultureInfo(culture)._name;
213InitSort(CultureInfo.GetCultureInfo(m_name));
221culture = CultureInfo.GetCultureInfo(Name).LCID; // This is the lcid of the constructing culture (still have to dereference to get target sort)
1591m_SortVersion = new SortVersion(0, CultureInfo.LOCALE_INVARIANT, new Guid(0, 0, 0, 0, 0, 0, 0,
1592(byte)(CultureInfo.LOCALE_INVARIANT >> 24),
1593(byte)((CultureInfo.LOCALE_INVARIANT & 0x00FF0000) >> 16),
1594(byte)((CultureInfo.LOCALE_INVARIANT & 0x0000FF00) >> 8),
1595(byte)(CultureInfo.LOCALE_INVARIANT & 0xFF)));
1613public int LCID => CultureInfo.GetCultureInfo(Name).LCID;
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (65)
73private CultureInfo? _consoleFallbackCulture;
99private static volatile CultureInfo? s_userDefaultCulture;
102private static volatile CultureInfo? s_userDefaultUICulture;
105private static readonly CultureInfo s_InvariantCultureInfo = new CultureInfo(CultureData.Invariant, isReadOnly: true);
108private static volatile CultureInfo? s_DefaultThreadCurrentUICulture;
109private static volatile CultureInfo? s_DefaultThreadCurrentCulture;
112private static CultureInfo? s_currentThreadCulture;
114private static CultureInfo? s_currentThreadUICulture;
116private static AsyncLocal<CultureInfo>? s_asyncLocalCurrentCulture;
117private static AsyncLocal<CultureInfo>? s_asyncLocalCurrentUICulture;
119private static void AsyncLocalSetCurrentCulture(AsyncLocalValueChangedArgs<CultureInfo> args)
124private static void AsyncLocalSetCurrentUICulture(AsyncLocalValueChangedArgs<CultureInfo> args)
129private static Dictionary<string, CultureInfo>? s_cachedCulturesByName;
130private static Dictionary<int, CultureInfo>? s_cachedCulturesByLcid;
133private CultureInfo? _parent;
144private static CultureInfo InitializeUserDefaultCulture()
150private static CultureInfo InitializeUserDefaultUICulture()
170_isInherited = GetType() != typeof(CultureInfo);
181private static CultureInfo? CreateCultureInfoNoThrow(string name, bool useUserOverride)
211_isInherited = GetType() != typeof(CultureInfo);
234CultureInfo altCulture = GetCultureInfo(textAndCompareCultureName);
243private static CultureInfo GetCultureByName(string name)
267public static CultureInfo CreateSpecificCulture(string name)
269CultureInfo? culture;
336internal static bool VerifyCultureName(CultureInfo culture, bool throwException)
363public static CultureInfo CurrentCulture
378Interlocked.CompareExchange(ref s_asyncLocalCurrentCulture, new AsyncLocal<CultureInfo>(AsyncLocalSetCurrentCulture), null);
384public static CultureInfo CurrentUICulture
400Interlocked.CompareExchange(ref s_asyncLocalCurrentUICulture, new AsyncLocal<CultureInfo>(AsyncLocalSetCurrentUICulture), null);
408internal static CultureInfo UserDefaultUICulture => s_userDefaultUICulture ?? InitializeUserDefaultUICulture();
410public static CultureInfo InstalledUICulture => s_userDefaultCulture ?? InitializeUserDefaultCulture();
412public static CultureInfo? DefaultThreadCurrentCulture
421public static CultureInfo? DefaultThreadCurrentUICulture
449public static CultureInfo InvariantCulture
461public virtual CultureInfo Parent
467CultureInfo culture;
519Interlocked.CompareExchange<CultureInfo?>(ref _parent, culture, null);
529public static CultureInfo[] GetCultures(CultureTypes types)
643if (value is CultureInfo that)
866public CultureInfo GetConsoleFallbackUICulture()
868CultureInfo? temp = _consoleFallbackCulture;
880CultureInfo ci = (CultureInfo)MemberwiseClone();
923public static CultureInfo ReadOnly(CultureInfo ci)
931CultureInfo newInfo = (CultureInfo)(ci.MemberwiseClone());
993public static CultureInfo GetCultureInfo(int culture)
997Dictionary<int, CultureInfo> lcidTable = CachedCulturesByLcid;
998CultureInfo? result;
1029public static CultureInfo GetCultureInfo(string name)
1034Dictionary<string, CultureInfo> nameTable = CachedCulturesByName;
1035CultureInfo? result;
1066public static CultureInfo GetCultureInfo(string name, string altName)
1074Dictionary<string, CultureInfo> nameTable = CachedCulturesByName;
1075CultureInfo? result;
1105public static CultureInfo GetCultureInfo(string name, bool predefinedOnly)
1120private static Dictionary<string, CultureInfo> CachedCulturesByName
1124Dictionary<string, CultureInfo>? cache = s_cachedCulturesByName;
1127cache = new Dictionary<string, CultureInfo>();
1135private static Dictionary<int, CultureInfo> CachedCulturesByLcid
1139Dictionary<int, CultureInfo>? cache = s_cachedCulturesByLcid;
1142cache = new Dictionary<int, CultureInfo>();
1150public static CultureInfo GetCultureInfoByIetfLanguageTag(string name)
1158CultureInfo ci = GetCultureInfo(name);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (5)
143internal static readonly DateTimeFormatInfo InvariantFormatInfo = CultureInfo.InvariantCulture.DateTimeFormat;
656AppendString(ref result, year.ToString("D" + tokenLen.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture));
780fraction.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(chars), out charCount, fractionFormat, CultureInfo.InvariantCulture) :
781fraction.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(chars), out charCount, fractionFormat, CultureInfo.InvariantCulture);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (12)
54return CultureInfo.CurrentCulture.CompareInfo.Compare(span, other, string.GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
104return CultureInfo.CurrentCulture.CompareInfo.Compare(span, other, string.GetCaseCompareOfComparisonCulture(comparisonType));
140return CultureInfo.CurrentCulture.CompareInfo.IndexOf(span, value, string.GetCaseCompareOfComparisonCulture(comparisonType));
175return CultureInfo.CurrentCulture.CompareInfo.LastIndexOf(span, value, string.GetCaseCompareOfComparisonCulture(comparisonType));
194/// <remarks>If <paramref name="culture"/> is null, <see cref="CultureInfo.CurrentCulture"/> will be used.</remarks>
197public static int ToLower(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture)
202culture ??= CultureInfo.CurrentCulture;
246/// <remarks>If <paramref name="culture"/> is null, <see cref="CultureInfo.CurrentCulture"/> will be used.</remarks>
249public static int ToUpper(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture)
254culture ??= CultureInfo.CurrentCulture;
306return CultureInfo.CurrentCulture.CompareInfo.IsSuffix(span, value, string.GetCaseCompareOfComparisonCulture(comparisonType));
344return CultureInfo.CurrentCulture.CompareInfo.IsPrefix(span, value, string.GetCaseCompareOfComparisonCulture(comparisonType));
src\libraries\System.Private.CoreLib\src\System\Reflection\Binder.cs (3)
11public abstract FieldInfo BindToField(BindingFlags bindingAttr, FieldInfo[] match, object value, CultureInfo? culture);
12public abstract MethodBase BindToMethod(BindingFlags bindingAttr, MethodBase[] match, ref object?[] args, ParameterModifier[]? modifiers, CultureInfo? culture, string[]? names, out object? state);
13public abstract object ChangeType(object value, Type type, CultureInfo? culture);
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (4)
211public void SetValue(object? obj, object? value, BindingFlags invokeAttr, Binder? binder, CultureInfo? culture)
335private void VerifyStaticField(ref object? value, BindingFlags invokeAttr, Binder? binder, CultureInfo? culture)
341private void VerifyInstanceField(object? obj, ref object? value, BindingFlags invokeAttr, Binder? binder, CultureInfo? culture)
366private void CheckValue(ref object? value, BindingFlags invokeAttr, Binder? binder, CultureInfo? culture)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (1)
20CultureInfo? culture)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (21)
110private CultureInfo? _neutralResourcesCulture; // For perf optimizations.
323protected virtual string GetResourceFileName(CultureInfo culture)
332CultureInfo.VerifyCultureName(culture.Name, throwException: true);
339internal ResourceSet? GetFirstResourceSet(CultureInfo culture)
344culture = CultureInfo.InvariantCulture;
392public virtual ResourceSet? GetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
428protected virtual ResourceSet? InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
435CultureInfo? foundCulture = null;
446foreach (CultureInfo currentCultureInfo in mgr)
482foreach (CultureInfo updateCultureInfo in mgr)
546protected static CultureInfo GetNeutralResourcesLanguage(Assembly a)
595public virtual string? GetString(string name, CultureInfo? culture)
599culture ??= CultureInfo.CurrentUICulture;
614foreach (CultureInfo currentCultureInfo in mgr)
656public virtual object? GetObject(string name, CultureInfo? culture)
661private object? GetObject(string name, CultureInfo? culture, bool wrapUnmanagedMemStream)
667culture = CultureInfo.CurrentUICulture;
689foreach (CultureInfo currentCultureInfo in mgr)
728public UnmanagedMemoryStream? GetStream(string name, CultureInfo? culture)
756internal CultureInfo? NeutralResourcesCulture
762internal string GetResourceFileName(CultureInfo culture) =>
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (22)
241return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, GetCaseCompareOfComparisonCulture(comparisonType));
269public static int Compare(string? strA, string? strB, CultureInfo? culture, CompareOptions options)
271CultureInfo compareCulture = culture ?? CultureInfo.CurrentCulture;
281public static int Compare(string? strA, string? strB, bool ignoreCase, CultureInfo? culture)
332return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, indexA, lengthA, strB, indexB, lengthB, options);
340public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, bool ignoreCase, CultureInfo? culture)
350public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, CultureInfo? culture, CompareOptions options)
352CultureInfo compareCulture = culture ?? CultureInfo.CurrentCulture;
410return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, indexA, lengthA, strB, indexB, lengthB, GetCaseCompareOfComparisonCulture(comparisonType));
558return CultureInfo.CurrentCulture.CompareInfo.IsSuffix(this, value, GetCaseCompareOfComparisonCulture(comparisonType));
579public bool EndsWith(string value, bool ignoreCase, CultureInfo? culture)
588CultureInfo referenceCulture = culture ?? CultureInfo.CurrentCulture;
666return CultureInfo.CurrentCulture.CompareInfo.Compare(this, value, GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
724return CultureInfo.CurrentCulture.CompareInfo.Compare(a, b, GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
789return CultureInfo.CurrentCulture.CompareInfo.GetHashCode(value, GetCaseCompareOfComparisonCulture(comparisonType));
1127return CultureInfo.CurrentCulture.CompareInfo.IsPrefix(this, value, GetCaseCompareOfComparisonCulture(comparisonType));
1157public bool StartsWith(string value, bool ignoreCase, CultureInfo? culture)
1166CultureInfo referenceCulture = culture ?? CultureInfo.CurrentCulture;
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (10)
991var result = new DefaultInterpolatedStringHandler(0, 0, CultureInfo.CurrentCulture, stackalloc char[StackallocCharBufferSizeLimit]);
1191public string Replace(string oldValue, string? newValue, bool ignoreCase, CultureInfo? culture)
1199StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => ReplaceCore(oldValue, newValue, CultureInfo.CurrentCulture.CompareInfo, GetCaseCompareOfComparisonCulture(comparisonType)),
1216return ReplaceCore(this, oldValue.AsSpan(), newValue.AsSpan(), ci ?? CultureInfo.CurrentCulture.CompareInfo, options)
2298public string ToLower(CultureInfo? culture)
2300CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
2313public string ToUpper(CultureInfo? culture)
2315CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (3)
59StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.IndexOf(this, value, GetCaseCompareOfComparisonCulture(comparisonType)),
258StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.IndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
383StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.LastIndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (8)
51serializedText.AppendSpanFormattable(zone.BaseUtcOffset.TotalMinutes, format: default, CultureInfo.InvariantCulture);
68serializedText.AppendSpanFormattable(rule.DaylightDelta.TotalMinutes, format: default, CultureInfo.InvariantCulture);
78serializedText.AppendSpanFormattable(rule.BaseUtcOffsetDelta.TotalMinutes, format: default, CultureInfo.InvariantCulture);
159serializedText.AppendSpanFormattable(time.Month, format: default, CultureInfo.InvariantCulture);
163serializedText.AppendSpanFormattable(time.Day, format: default, CultureInfo.InvariantCulture);
168serializedText.AppendSpanFormattable(time.Week, format: default, CultureInfo.InvariantCulture);
170serializedText.AppendSpanFormattable((int)time.DayOfWeek, format: default, CultureInfo.InvariantCulture);
363if (!int.TryParse(token, NumberStyles.AllowLeadingSign /* "[sign]digits" */, CultureInfo.InvariantCulture, out int value))
src\libraries\System.Private.CoreLib\src\System\Type.cs (2)
586public object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, CultureInfo? culture) => InvokeMember(name, invokeAttr, binder, target, args, null, culture, null);
589public abstract object? InvokeMember(string name, BindingFlags invokeAttr, Binder? binder, object? target, object?[]? args, ParameterModifier[]? modifiers, CultureInfo? culture, string[]? namedParameters);
System.Private.DataContractSerialization (31)
System\Xml\XmlBufferReader.cs (6)
431throw XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "DateTime", exception);
435throw XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "DateTime", exception);
439throw XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "DateTime", exception);
453throw XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "TimeSpan", exception);
457throw XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "TimeSpan", exception);
461throw XmlExceptionHelper.CreateConversionException(value.ToString(CultureInfo.InvariantCulture), "TimeSpan", exception);
System.Private.Uri (3)
System.Private.Windows.Core (4)
System.Private.Windows.Core.TestUtilities (37)
System.Private.Windows.GdiPlus (1)
System.Private.Xml (183)
System\Xml\Schema\XsdDuration.cs (6)
366vsb.AppendSpanFormattable(_years, null, CultureInfo.InvariantCulture);
372vsb.AppendSpanFormattable(_months, null, CultureInfo.InvariantCulture);
381vsb.AppendSpanFormattable(_days, null, CultureInfo.InvariantCulture);
390vsb.AppendSpanFormattable(_hours, null, CultureInfo.InvariantCulture);
396vsb.AppendSpanFormattable(_minutes, null, CultureInfo.InvariantCulture);
403vsb.AppendSpanFormattable(_seconds, null, CultureInfo.InvariantCulture);
System\Xml\Serialization\XmlSerializationReader.cs (21)
1005if (!int.TryParse(lengthStringSpan, CultureInfo.InvariantCulture, out soapArrayInfo.length))
1065soapArrayInfo.length = int.Parse(dimensions[i], CultureInfo.InvariantCulture);
1547throw new InvalidOperationException(SR.Format(SR.XmlInvalidArrayRef, id, o.GetType().FullName, i.ToString(CultureInfo.InvariantCulture)));
2113_arrayName = string.Create(CultureInfo.InvariantCulture, $"{arrayName}_{i}");
2487Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture));
2635Writer.Write(i.ToString(CultureInfo.InvariantCulture));
2667Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture));
2816string.Create(CultureInfo.InvariantCulture, $"Read{++NextMethodNumber}_{CodeIdentifier.MakeValidInternal(name)}");
2819string.Create(CultureInfo.InvariantCulture, $"id{(++_nextIdNumber)}_{CodeIdentifier.MakeValidInternal(name)}");
2886uniqueName = name + i.ToString(CultureInfo.InvariantCulture);
2946Writer.Write(string.Create(CultureInfo.InvariantCulture, $"{constants[i].Value}L"));
3511string fixupIndex = member.FixupIndex.ToString(CultureInfo.InvariantCulture);
3565string createName = string.Create(CultureInfo.InvariantCulture, $"create{++_nextCreateMethodNumber}_{typeDesc.Name}");
3889Writer.Write(fixupCount.ToString(CultureInfo.InvariantCulture));
4001StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
4230Writer.Write(cases.ToString(CultureInfo.InvariantCulture));
4306Writer.Write(member.FixupIndex.ToString(CultureInfo.InvariantCulture));
4339Writer.Write(cases.ToString(CultureInfo.InvariantCulture));
4530Writer.Write((fixupIndex).ToString(CultureInfo.InvariantCulture));
4748Writer.Write((fixupIndex).ToString(CultureInfo.InvariantCulture));
4972Writer.Write(length.ToString(CultureInfo.InvariantCulture));
System\Xml\Serialization\XmlSerializationWriter.cs (21)
587long index = long.Parse(name.AsSpan(prefixLength), NumberStyles.Integer, CultureInfo.InvariantCulture);
901id = string.Create(CultureInfo.InvariantCulture, $"{_idBase}id{++_nextId}");
1269_w.WriteAttributeString("arraySize", Soap12.Encoding, arrayLength.ToString(CultureInfo.InvariantCulture));
1292_w.WriteAttributeString("arraySize", Soap12.Encoding, arrayLength.ToString(CultureInfo.InvariantCulture));
1685_writer.Write(string.Format(CultureInfo.InvariantCulture, HelperClassesForUseReflection,
2117_writer.Write(c.Value.ToString(CultureInfo.InvariantCulture));
2638Writer.Write(xmlnsMember.ToString(CultureInfo.InvariantCulture));
2652string index = i.ToString(CultureInfo.InvariantCulture);
2679Writer.Write(specifiedPosition.ToString(CultureInfo.InvariantCulture));
2725string index = i.ToString(CultureInfo.InvariantCulture);
2734Writer.Write(specifiedPosition.ToString(CultureInfo.InvariantCulture));
2795Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture));
2799WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength");
2858return string.Create(CultureInfo.InvariantCulture, $"Write{++NextMethodNumber}_{CodeIdentifier.MakeValidInternal(name)}");
2931Writer.Write(c.Value.ToString(CultureInfo.InvariantCulture));
4345Writer.Write(((DateTime)value).Ticks.ToString(CultureInfo.InvariantCulture));
4353Writer.Write(((DateTimeOffset)value).Ticks.ToString(CultureInfo.InvariantCulture));
4357Writer.Write(((DateTimeOffset)value).Offset.Ticks.ToString(CultureInfo.InvariantCulture));
4365Writer.Write(((TimeSpan)value).Ticks.ToString(CultureInfo.InvariantCulture));
4458enumValue = choiceMapping.Constants[i].Value.ToString(CultureInfo.InvariantCulture);
4474enumValue = choiceMapping.Constants[i].Value.ToString(CultureInfo.InvariantCulture);
System\Xml\XmlConvert.cs (19)
622return value.ToString(null, CultureInfo.InvariantCulture);
627return value.ToString(null, CultureInfo.InvariantCulture);
632return value.ToString(null, CultureInfo.InvariantCulture);
637return value.ToString(null, CultureInfo.InvariantCulture);
642return value.ToString(null, CultureInfo.InvariantCulture);
648return value.ToString(null, CultureInfo.InvariantCulture);
654return value.ToString(null, CultureInfo.InvariantCulture);
660return value.ToString(null, CultureInfo.InvariantCulture);
1588((uint)hi).ToString("X", CultureInfo.InvariantCulture),
1589((uint)low).ToString("X", CultureInfo.InvariantCulture)
1606return CreateException(SR.Xml_InvalidSurrogateHighChar, ((uint)hi).ToString("X", CultureInfo.InvariantCulture), exceptionType, lineNo, linePos);
1663return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1668return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1673return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1678return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1683return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1688return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1693return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
1698return value.TryFormat(destination, out charsWritten, default, CultureInfo.InvariantCulture);
System.Private.Xml.Linq (11)
System.Reflection.Context (16)
System.Reflection.Emit (13)
System.Reflection.Metadata (2)
System.Reflection.MetadataLoadContext (14)
System.Runtime (1)
System.Runtime.Caching (14)
System.Runtime.Serialization.Formatters (32)
System.Security.Cryptography.Xml (34)
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (34)
244keyName = key.GetHashCode().ToString("x8", CultureInfo.InvariantCulture);
286string logMessage = SR.Format(CultureInfo.InvariantCulture,
298string canonicalizationSettings = SR.Format(CultureInfo.InvariantCulture,
323string logMessage = SR.Format(CultureInfo.InvariantCulture,
344string logMessage = SR.Format(CultureInfo.InvariantCulture,
370string contextData = SR.Format(CultureInfo.InvariantCulture,
400string contextData = SR.Format(CultureInfo.InvariantCulture,
425string logMessage = SR.Format(CultureInfo.InvariantCulture,
478string logMessage = SR.Format(CultureInfo.InvariantCulture,
528string logMessage = SR.Format(CultureInfo.InvariantCulture,
552string propagationMessage = SR.Format(CultureInfo.InvariantCulture,
603string logMessage = SR.Format(CultureInfo.InvariantCulture,
642string logMessage = SR.Format(CultureInfo.InvariantCulture,
668string logMessage = SR.Format(CultureInfo.InvariantCulture,
694string logMessage = SR.Format(CultureInfo.InvariantCulture,
719string logMessage = SR.Format(CultureInfo.InvariantCulture,
745string logMessage = string.Format(CultureInfo.InvariantCulture,
769string logMessage = SR.Format(CultureInfo.InvariantCulture,
794string logMessage = SR.Format(CultureInfo.InvariantCulture,
830string logMessage = SR.Format(CultureInfo.InvariantCulture,
871string logMessage = SR.Format(CultureInfo.InvariantCulture,
885string hashLog = SR.Format(CultureInfo.InvariantCulture,
890string signatureLog = SR.Format(CultureInfo.InvariantCulture,
915string logMessage = SR.Format(CultureInfo.InvariantCulture,
926string hashLog = SR.Format(CultureInfo.InvariantCulture,
931string signatureLog = SR.Format(CultureInfo.InvariantCulture,
952string buildMessage = SR.Format(CultureInfo.InvariantCulture,
964string revocationMode = SR.Format(CultureInfo.InvariantCulture,
969string revocationFlag = SR.Format(CultureInfo.InvariantCulture,
974string verificationFlags = SR.Format(CultureInfo.InvariantCulture,
979string verificationTime = SR.Format(CultureInfo.InvariantCulture,
984string urlTimeout = SR.Format(CultureInfo.InvariantCulture,
997string logMessage = SR.Format(CultureInfo.InvariantCulture,
1045string logMessage = SR.Format(CultureInfo.InvariantCulture,
System.ServiceModel.Federation (2)
System.ServiceModel.NetFramingBase (6)
System.ServiceModel.NetNamedPipe (5)
System.ServiceModel.Primitives (2)
System.ServiceModel.Primitives.Tests (1)
System.ServiceModel.Syndication (11)
System.ServiceModel.UnixDomainSocket (4)
System.Speech (12)
System.Text.Json (10)
System.Text.Json.SourceGeneration (4)
System.Text.RegularExpressions (40)
System\Text\RegularExpressions\Regex.cs (6)
70internal Regex(string pattern, CultureInfo? culture)
88internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture)
120private RegexTree Init(string pattern, RegexOptions options, TimeSpan matchTimeout, [NotNull] ref CultureInfo? culture)
253RegexTree tree = RegexParser.Parse(pattern, options, (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture);
393return uint.TryParse(name, NumberStyles.None, CultureInfo.InvariantCulture, out uint result) && result < capsize ? (int)result : -1;
System\Text\RegularExpressions\RegexParser.cs (11)
32private readonly CultureInfo _culture;
55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan)
85internal static CultureInfo GetTargetCulture(RegexOptions options) =>
87(options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture;
92using var parser = new RegexParser(pattern, options, CultureInfo.InvariantCulture, // since we won't perform case conversions, culture doesn't matter in this case.
103public static RegexTree Parse(string pattern, RegexOptions options, CultureInfo culture)
140CultureInfo culture = (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture;
223var parser = new RegexParser(input, RegexOptions.None, CultureInfo.InvariantCulture, new Hashtable(), 0, null, stackalloc int[OptionStackDefaultSize]);
System.Text.RegularExpressions.Generator (33)
RegexGenerator.Parser.cs (4)
149CultureInfo culture = CultureInfo.InvariantCulture;
170culture = CultureInfo.GetCultureInfo(cultureName);
260internal sealed record RegexPatternAndSyntax(RegexType DeclaringType, bool IsProperty, Location DiagnosticLocation, string MemberName, string Modifiers, bool NullableRegex, string Pattern, RegexOptions Options, int? MatchTimeout, CultureInfo Culture, CompilationData CompilationData);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (11)
32private readonly CultureInfo _culture;
55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan)
85internal static CultureInfo GetTargetCulture(RegexOptions options) =>
87(options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture;
92using var parser = new RegexParser(pattern, options, CultureInfo.InvariantCulture, // since we won't perform case conversions, culture doesn't matter in this case.
103public static RegexTree Parse(string pattern, RegexOptions options, CultureInfo culture)
140CultureInfo culture = (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture;
223var parser = new RegexParser(input, RegexOptions.None, CultureInfo.InvariantCulture, new Hashtable(), 0, null, stackalloc int[OptionStackDefaultSize]);
System.Transactions.Local (2)
System.Web.HttpUtility (2)
System.Windows.Controls.Ribbon (33)
Microsoft\Windows\Controls\Ribbon\RibbonContextMenu.cs (4)
413public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
443public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
478public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
489public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
System.Windows.Forms (233)
System\Windows\Forms\ComponentModel\COM2Interop\COM2Enum.cs (5)
57if (string.Compare(_names[i], value, true, CultureInfo.InvariantCulture) == 0 ||
58string.Compare(_stringValues[i], value, true, CultureInfo.InvariantCulture) == 0)
63if (bestMatch == -1 && string.Compare(_names[i], value, true, CultureInfo.InvariantCulture) == 0)
99value = Convert.ChangeType(value, _values[0].GetType(), CultureInfo.InvariantCulture);
115if (string.Compare(_stringValues[i], stringValue, true, CultureInfo.InvariantCulture) == 0)
System\Windows\Forms\Controls\ListControl\ListControl.cs (4)
498found = string.Compare(str, GetItemText(items[index]), ignoreCase, CultureInfo.CurrentCulture) == 0;
502found = string.Compare(str, 0, GetItemText(items[index]), 0, str.Length, ignoreCase, CultureInfo.CurrentCulture) == 0;
529return Convert.ToString(item, CultureInfo.CurrentCulture);
568return Convert.ToString(item, CultureInfo.CurrentCulture);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (5)
1139private static string FormatDate(DateTime value) => value.ToString("d", CultureInfo.CurrentCulture);
1761throw new ArgumentOutOfRangeException(nameof(x), string.Format(SR.MonthCalendarInvalidDimensions, (x).ToString("D", CultureInfo.CurrentCulture), (y).ToString("D", CultureInfo.CurrentCulture)));
1766throw new ArgumentOutOfRangeException(nameof(y), string.Format(SR.MonthCalendarInvalidDimensions, (x).ToString("D", CultureInfo.CurrentCulture), (y).ToString("D", CultureInfo.CurrentCulture)));
System\Windows\Forms\Input\KeysConverter.cs (15)
17private Dictionary<CultureInfo, List<string>>? _cultureToDisplayOrder;
18private Dictionary<CultureInfo, Dictionary<string, Keys>>? _cultureToKeyName;
27AddLocalizedKeyNames(CultureInfo.InvariantCulture);
30private void AddLocalizedKeyNames(CultureInfo cultureInfo)
99private Dictionary<CultureInfo, Dictionary<string, Keys>> CultureToKeyName
112private Dictionary<CultureInfo, List<string>> CultureToDisplayOrder
144return string.Compare(ConvertToString(a), ConvertToString(b), false, CultureInfo.InvariantCulture);
150public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
203finalValue |= Convert.ToInt64(e, CultureInfo.InvariantCulture);
219public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
331private List<string> GetDisplayOrder(CultureInfo? culture)
335culture ??= CultureInfo.CurrentUICulture;
344private Dictionary<string, Keys> GetKeyNames(CultureInfo? culture)
348culture ??= CultureInfo.CurrentUICulture;
362var keys = CultureToKeyName[CultureInfo.InvariantCulture]!.Values.ToList();
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettingsTypeConverter.cs (7)
45public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value)
63public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
83xmlWriter.WriteAttributeString("Row", c.Row.ToString(CultureInfo.CurrentCulture));
84xmlWriter.WriteAttributeString("RowSpan", c.RowSpan.ToString(CultureInfo.CurrentCulture));
86xmlWriter.WriteAttributeString("Column", c.Column.ToString(CultureInfo.CurrentCulture));
87xmlWriter.WriteAttributeString("ColumnSpan", c.ColumnSpan.ToString(CultureInfo.CurrentCulture));
228if (!float.TryParse(floatString, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out float width))
System.Windows.Forms.Analyzers (2)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
System.Windows.Forms.Analyzers.CSharp (3)
System.Windows.Forms.Analyzers.CSharp.Tests (9)
System.Windows.Forms.Analyzers.VisualBasic (1)
System.Windows.Forms.Design (141)
System.Windows.Forms.Design.Tests (9)
System.Windows.Forms.IntegrationTests.Common (1)
System.Windows.Forms.Primitives (7)
System.Windows.Forms.Tests (125)
System.Windows.Input.Manipulations (11)
System.Xaml (34)
System.Xaml.Tests (22)
System\Windows\Markup\XamlSetTypeConverterEventArgsTests.cs (2)
18yield return new object?[] { new XamlMember("name", type, false), new Int32Converter(), new object(), new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture };
23public void Ctor_XamlMember_TypeConverter_Object_ITypeDescriptorContext_CultureInfo(XamlMember member, TypeConverter typeConverter, object value, ITypeDescriptorContext serviceProvider, CultureInfo cultureInfo)
System\Xaml\Replacements\DateTimeOffsetConverter2Tests.cs (5)
32yield return new object?[] { dateTimeOffset.ToString("O", CultureInfo.CurrentCulture), null, dateTimeOffset };
33yield return new object?[] { " " + dateTimeOffset.ToString("O", CultureInfo.CurrentCulture) + " ", null, dateTimeOffset };
39public void ConvertFrom_String_ReturnsExpected(string value, CultureInfo culture, DateTimeOffset expected)
76public void ConvertTo_DateTimeOffset_ReturnsExpected(DateTimeOffset dateTimeOffset, CultureInfo culture)
80Assert.Equal(dateTimeOffset.ToString("O", culture ?? CultureInfo.CurrentCulture), converter.ConvertTo(null, culture, dateTimeOffset, typeof(string)));
TagHelpersWebSite (2)
TaskUsageLogger (9)
TaskUsageLogger.cs (9)
129throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Failed to load and read task registration information from project '{0}'. {1}", e.ProjectFile, ex.Message));
178throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Why do we have two instances of {0}?", t));
195throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Why is toolset '{0}' missing??", toolsVersion));
303throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "This logger doesn't know how to evaluate '{0}'!", unevaluatedString));
337throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Why haven't we collected using task data for {0}?", projectFile));
350throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Why don't we have a cached ToolsVersion for {0}?", projectFile));
356throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Why haven't we collected default using task data for TV {0}?", parentProjectToolsVersion));
364throw new LoggerException(String.Format(CultureInfo.CurrentCulture, "Why couldn't we find a matching UsingTask for task {0} in project {1}?", taskName, projectFile));
437return String.Format(CultureInfo.CurrentCulture, "{0}, {1}, {2}, {3}, {4}, {5}", this.TaskName, this.TargetName, this.FilePath, this.ProjectPath, this.TaskAssembly, this.TaskId);
Templates.Blazor.Tests (17)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
Templates.Blazor.WebAssembly.Auth.Tests (19)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
Templates.Blazor.WebAssembly.Tests (19)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
Templates.Mvc.Tests (19)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
Templates.Tests (19)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (5)
161string.Format(CultureInfo.InvariantCulture, MacOSVerifyCertificateCommandLineArgumentsFormat, tmpFile))
209CultureInfo.InvariantCulture,
242CultureInfo.InvariantCulture,
290string.Format(CultureInfo.InvariantCulture, MacOSFindCertificateOnKeychainCommandLineArgumentsFormat, subject, keychain))
347string.Format(CultureInfo.InvariantCulture, MacOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (11)
121CultureInfo.CurrentCulture,
424Out.WriteLine(string.Format(CultureInfo.CurrentCulture, "Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
444headerBuilder.Insert(6, string.Format(CultureInfo.InvariantCulture, " {0}", cmd.Name));
459headerBuilder.AppendFormat(CultureInfo.InvariantCulture, " {0}", commandName);
481var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxArgLen + 2);
484argumentsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, arg.Name, arg.Description);
497var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxOptLen + 2);
500optionsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, opt.Template, opt.Description);
513var outputFormat = string.Format(CultureInfo.InvariantCulture, " {{0, -{0}}}{{1}}", maxCmdLen + 2);
516commandsBuilder.AppendFormat(CultureInfo.InvariantCulture, outputFormat, cmd.Name, cmd.Description);
560return ShortVersionGetter == null ? FullName : string.Format(CultureInfo.InvariantCulture, "{0} {1}", FullName, ShortVersionGetter());
Test.Utilities (3)
TestPassApp (2)
TestProject.AppHost (1)
TestStartupAssembly1 (2)
Text.Analyzers (5)
Text.Analyzers.UnitTests (5)
UIAutomationClient (17)
UIAutomationClientSideProviders (44)
MS\Internal\AutomationProxies\Accessible.cs (4)
1158Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected exception thrown for AccessibleChildren: {0}", e));
1166Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected hresult from AccessibleChildren: {0} count is {1} and actualCount is {2}", hr, count, actualCount));
1370Debug.Fail(string.Format(CultureInfo.CurrentCulture, "MsaaNativeProvider: IAccessible threw a COMException: {0}", e.Message));
1387Debug.Fail(string.Format(CultureInfo.CurrentCulture, "Unexpected IAccessible exception: {0}", e));
MS\Internal\AutomationProxies\WindowsMenu.cs (20)
1178_sAutomationId = "Separator " + (_item + 1).ToString(CultureInfo.InvariantCulture); // This string is a non-localizable string
1326string menuText = menuRawText.ToLower(CultureInfo.InvariantCulture);
1329if ((accelerator = AccelatorKeyCtrl(keyCtrl.ToLower(CultureInfo.InvariantCulture), keyCtrl + " + ", menuText, menuRawText, out pos)) != null ||
1330(accelerator = AccelatorKeyCtrl(keyControl.ToLower(CultureInfo.InvariantCulture), keyCtrl + " + ", menuText, menuRawText, out pos)) != null ||
1331(accelerator = AccelatorKeyCtrl(keyAlt.ToLower(CultureInfo.InvariantCulture), keyAlt + " + ", menuText, menuRawText, out pos)) != null ||
1332(accelerator = AccelatorKeyCtrl(keyShift.ToLower(CultureInfo.InvariantCulture), keyShift + " + ", menuText, menuRawText, out pos)) != null ||
1333(accelerator = AccelatorKeyCtrl(keyWin.ToLower(CultureInfo.InvariantCulture), keyWin + " + ", menuText, menuRawText, out pos)) != null)
2449return string.Format(CultureInfo.CurrentCulture, "{0}{1}{2}", sCanonicalsKeyword, menuText.Substring(pos + cKeyChars + 1, cMenuChars - (pos + cKeyChars + 2)), Char.ToUpper(menuText[cMenuChars - 1], CultureInfo.InvariantCulture));
2477int iKey = int.Parse(menuText.AsSpan(pos + 1, cChars - (pos + 1)), CultureInfo.InvariantCulture);
2480return "F" + iKey.ToString(CultureInfo.CurrentCulture);
2506itemId = "Item " + result.ToString(CultureInfo.CurrentCulture);
2513itemId = "Item " + (_item + 1).ToString(CultureInfo.CurrentCulture);
2750string menuText = menuRawText.ToLower(CultureInfo.InvariantCulture);
2753if ((accelerator = AccelatorKeyCtrl(keyCtrl.ToLower(CultureInfo.InvariantCulture), keyCtrl + " + ", menuText, menuRawText, out pos)) != null ||
2754(accelerator = AccelatorKeyCtrl(keyControl.ToLower(CultureInfo.InvariantCulture), keyCtrl + " + ", menuText, menuRawText, out pos)) != null ||
2755(accelerator = AccelatorKeyCtrl(keyAlt.ToLower(CultureInfo.InvariantCulture), keyAlt + " + ", menuText, menuRawText, out pos)) != null ||
2756(accelerator = AccelatorKeyCtrl(keyShift.ToLower(CultureInfo.InvariantCulture), keyShift + " + ", menuText, menuRawText, out pos)) != null ||
2757(accelerator = AccelatorKeyCtrl(keyWin.ToLower(CultureInfo.InvariantCulture), keyWin + " + ", menuText, menuRawText, out pos)) != null)
2857_sAutomationId = "Item " + (item).ToString(CultureInfo.CurrentCulture);
UIAutomationTypes (1)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (1)
69return String.Format(System.Globalization.CultureInfo.CurrentCulture,"[{0}, {1}, {2}, {3}, {4}, {5}]", this.eM11, this.eM12, this.eM21, this.eM22, this.eDx, this.eDy );
VBCSCompiler (2)
VersioningWebSite (3)
VisualBasicSyntaxGenerator (1)
Wasm.Performance.ConsoleHost (12)
WindowsBase.Tests (117)
System\Windows\Input\KeyConverterTests.cs (10)
143Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
156Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
169Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
181Assert.Throws<InvalidCastException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
206Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
225Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, Key.None, null!));
371Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
380Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
403Assert.Throws<ArgumentException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
420Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\Input\ModifierKeysConverterTests.cs (10)
100Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
118Assert.Throws<InvalidEnumArgumentException>("value", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
135Assert.Throws<NullReferenceException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
147Assert.Throws<InvalidCastException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
172Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
191Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, Key.None, null!));
249Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
258Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
277Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
294Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\Int32RectConverterTests.cs (10)
32Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, matrix, typeof(string)));
39var culture = new CultureInfo("en-US");
57Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
82Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
101Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Int32Rect(), null!));
125Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
134Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
144Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
154Assert.Throws<FormatException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
170Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\Media\MatrixConverterTests.cs (10)
32Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
39var culture = new CultureInfo("en-US");
57Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
82Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
101Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Matrix(), null!));
125Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
134Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
144Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
154Assert.Throws<FormatException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
170Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\PointConverterTests.cs (10)
32Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, matrix, typeof(string)));
39var culture = new CultureInfo("en-US");
57Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
82Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
101Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Point(), null!));
125Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
134Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
144Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
154Assert.Throws<FormatException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
170Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\RectConverterTests.cs (11)
32Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, matrix, typeof(string)));
39var culture = new CultureInfo("en-US");
57Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
82Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
101Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Rect(), null!));
125Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
134Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
144Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
154Assert.Throws<FormatException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
164Assert.Throws<ArgumentException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
180Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\SizeConverterTests.cs (11)
32Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, matrix, typeof(string)));
39var culture = new CultureInfo("en-US");
57Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
82Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
101Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Size(), null!));
125Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
134Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
144Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
154Assert.Throws<FormatException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
164Assert.Throws<ArgumentException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
180Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
System\Windows\VectorConverterTests.cs (10)
32Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, matrix, typeof(string)));
39var culture = new CultureInfo("en-US");
57Assert.Equal(expected, converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, typeof(string)));
82Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value, destinationType));
101Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, new Vector(), null!));
125Assert.Equal(expected, converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
134Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, null));
144Assert.Throws<InvalidOperationException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
154Assert.Throws<FormatException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
170Assert.Throws<NotSupportedException>(() => converter.ConvertFrom(new CustomTypeDescriptorContext(), CultureInfo.InvariantCulture, value));
WindowsFormsIntegration (12)
WinFormsControlsTest (2)
XmlFormattersWebSite (3)
xunit.assert (174)
EqualityAsserts.cs (42)
351 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", expectedRounded, expected),
352 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", actualRounded, actual),
353 string.Format(CultureInfo.CurrentCulture, "Values are not within {0} decimal place{1}", precision, precision == 1 ? "" : "s")
377 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", expectedRounded, expected),
378 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", actualRounded, actual),
379 string.Format(CultureInfo.CurrentCulture, "Values are not within {0} decimal place{1}", precision, precision == 1 ? "" : "s")
400 expected.ToString("G17", CultureInfo.CurrentCulture),
401 actual.ToString("G17", CultureInfo.CurrentCulture),
402 string.Format(CultureInfo.CurrentCulture, "Values are not within tolerance {0:G17}", tolerance)
423 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", expectedRounded, expected),
424 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", actualRounded, actual),
425 string.Format(CultureInfo.CurrentCulture, "Values are not within {0} decimal place{1}", precision, precision == 1 ? "" : "s")
449 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", expectedRounded, expected),
450 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", actualRounded, actual),
451 string.Format(CultureInfo.CurrentCulture, "Values are not within {0} decimal place{1}", precision, precision == 1 ? "" : "s")
472 expected.ToString("G9", CultureInfo.CurrentCulture),
473 actual.ToString("G9", CultureInfo.CurrentCulture),
474 string.Format(CultureInfo.CurrentCulture, "Values are not within tolerance {0:G9}", tolerance)
495 string.Format(CultureInfo.CurrentCulture, "{0} (rounded from {1})", expectedRounded, expected),
496 string.Format(CultureInfo.CurrentCulture, "{0} (rounded from {1})", actualRounded, actual)
528 (precision == TimeSpan.Zero ? "" : string.Format(CultureInfo.CurrentCulture, " (difference {0} is larger than {1})", difference, precision));
562 (precision == TimeSpan.Zero ? "" : string.Format(CultureInfo.CurrentCulture, " (difference {0} is larger than {1})", difference, precision));
832 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", expectedRounded, expected),
833 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", actualRounded, actual),
834 string.Format(CultureInfo.CurrentCulture, "Values are within {0} decimal places", precision)
858 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", expectedRounded, expected),
859 string.Format(CultureInfo.CurrentCulture, "{0:G17} (rounded from {1:G17})", actualRounded, actual),
860 string.Format(CultureInfo.CurrentCulture, "Values are within {0} decimal places", precision)
881 expected.ToString("G17", CultureInfo.CurrentCulture),
882 actual.ToString("G17", CultureInfo.CurrentCulture),
883 string.Format(CultureInfo.CurrentCulture, "Values are within tolerance {0:G17}", tolerance)
904 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", expectedRounded, expected),
905 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", actualRounded, actual),
906 string.Format(CultureInfo.CurrentCulture, "Values are within {0} decimal places", precision)
930 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", expectedRounded, expected),
931 string.Format(CultureInfo.CurrentCulture, "{0:G9} (rounded from {1:G9})", actualRounded, actual),
932 string.Format(CultureInfo.CurrentCulture, "Values are within {0} decimal places", precision)
953 expected.ToString("G9", CultureInfo.CurrentCulture),
954 actual.ToString("G9", CultureInfo.CurrentCulture),
955 string.Format(CultureInfo.CurrentCulture, "Values are within tolerance {0:G9}", tolerance)
976 string.Format(CultureInfo.CurrentCulture, "{0} (rounded from {1})", expectedRounded, expected),
977 string.Format(CultureInfo.CurrentCulture, "{0} (rounded from {1})", actualRounded, actual)
Sdk\ArgumentFormatter.cs (27)
168 builder.AppendFormat(CultureInfo.CurrentCulture, @"\x{0}", (+ch).ToString("x2", CultureInfo.CurrentCulture));
178 builder.AppendFormat(CultureInfo.CurrentCulture, @"\x{0}", (+ch).ToString("x4", CultureInfo.CurrentCulture));
195 return string.Format(CultureInfo.CurrentCulture, "typeof({0})", FormatTypeName(value, fullTypeName: true));
218 return string.Format(CultureInfo.CurrentCulture, "typeof({0})", FormatTypeName(valueAsType, fullTypeName: true));
267 : string.Format(CultureInfo.CurrentCulture, "Task<{0}>", string.Join(",", typeParameters.Select(t => FormatTypeName(t))));
269 return string.Format(CultureInfo.CurrentCulture, "{0} {{ Status = {1} }}", typeName, task.Status);
293 return string.Format(CultureInfo.CurrentCulture, "{0} was thrown formatting an object of type \"{1}\"", ex.GetType().Name, value.GetType());
309 return string.Format(CultureInfo.CurrentCulture, "'{0}'", escapeSequence);
312 return string.Format(CultureInfo.CurrentCulture, "'{0}'", value);
315 return string.Format(CultureInfo.CurrentCulture, "0x{0:x4}", (int)value);
331 return string.Format(CultureInfo.CurrentCulture, "{0}{{ {1} }}", typeName, Ellipsis);
353 return string.Format(CultureInfo.CurrentCulture, "{0}{{ }}", typeName);
355 var formattedParameters = string.Join(", ", parameters.Take(MAX_OBJECT_ITEM_COUNT).Select(p => string.Format(CultureInfo.CurrentCulture, "{0} = {1}", p.name, p.value)));
360 return string.Format(CultureInfo.CurrentCulture, "{0}{{ {1} }}", typeName, formattedParameters);
364 string.Format(CultureInfo.CurrentCulture, "{0:o}", value);
367 string.Format(CultureInfo.CurrentCulture, "{0:G17}", value);
430 string.Format(CultureInfo.CurrentCulture, "{0:G9}", value);
443 return string.Format(CultureInfo.CurrentCulture, "\"{0}\"{1}", displayed, Ellipsis);
446 return string.Format(CultureInfo.CurrentCulture, "\"{0}\"", value);
494 arraySuffix += string.Format(CultureInfo.CurrentCulture, "[{0}]", new string(',', rank - 1));
526 result = string.Format(CultureInfo.CurrentCulture, "{0}<{1}>", result, new string(',', typeInfo.GenericTypeParameters.Length - 1));
532 result = string.Format(CultureInfo.CurrentCulture, "{0}<{1}>", result, string.Join(", ", typeInfo.GenericTypeArguments.Select(t => FormatTypeName(t))));
550 return string.Format(CultureInfo.CurrentCulture, "[{0}] = {1}", Format(k), Format(v));
553 return Convert.ToString(value, CultureInfo.CurrentCulture) ?? "null";
715 return string.Format(CultureInfo.CurrentCulture, "(throws {0})", UnwrapException(ex)?.GetType().Name);
Sdk\Exceptions\CollectionException.cs (3)
81 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2})", Environment.NewLine, new string(' ', failurePointerIndent.Value), indexFailurePoint);
83 message += string.Format(CultureInfo.CurrentCulture, "{0}Collection: {1}{2}Error: {3}", Environment.NewLine, formattedCollection, Environment.NewLine, FormatInnerException(exception));
101 CultureInfo.CurrentCulture,
Sdk\Exceptions\DoesNotContainException.cs (11)
50 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2})", Environment.NewLine, new string(' ', failurePointerIndent.Value), indexFailurePoint);
52 message += string.Format(CultureInfo.CurrentCulture, "{0}Collection: {1}", Environment.NewLine, collection);
77 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2})", Environment.NewLine, new string(' ', failurePointerIndent.Value), indexFailurePoint);
79 message += string.Format(CultureInfo.CurrentCulture, "{0}Collection: {1}{2}Found: {3}", Environment.NewLine, collection, Environment.NewLine, item);
95 CultureInfo.CurrentCulture,
115 CultureInfo.CurrentCulture,
144 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2})", Environment.NewLine, new string(' ', failurePointerIndent.Value), indexFailurePoint);
146 message += string.Format(CultureInfo.CurrentCulture, "{0}Memory: {1}{2}Found: {3}", Environment.NewLine, memory, Environment.NewLine, expectedSubMemory);
171 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2})", Environment.NewLine, new string(' ', failurePointerIndent.Value), indexFailurePoint);
173 message += string.Format(CultureInfo.CurrentCulture, "{0}Span: {1}{2}Found: {3}", Environment.NewLine, span, Environment.NewLine, expectedSubSpan);
198 CultureInfo.CurrentCulture,
Sdk\Exceptions\EqualException.cs (11)
117 ? string.Format(CultureInfo.CurrentCulture, "Assert.Equal() Failure: {0} differ", collectionDisplay ?? "Collections")
120 var expectedTypeText = expectedType != null && actualType != null && expectedType != actualType ? string.Format(CultureInfo.CurrentCulture, ", type {0}", expectedType) : "";
121 var actualTypeText = expectedType != null && actualType != null && expectedType != actualType ? string.Format(CultureInfo.CurrentCulture, ", type {0}", actualType) : "";
124 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2}{3})", Environment.NewLine, new string(' ', expectedPointer.Value), mismatchedIndex, expectedTypeText);
126 message += string.Format(CultureInfo.CurrentCulture, "{0}Expected: {1}{2}Actual: {3}", Environment.NewLine, expected, Environment.NewLine, actual);
129 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2191 (pos {2}{3})", Environment.NewLine, new string(' ', actualPointer.Value), mismatchedIndex, actualTypeText);
162 message += string.Format(CultureInfo.CurrentCulture, "{0}{1}\u2193 (pos {2})", newLineAndIndent, new string(' ', expectedPointer), expectedIndex);
164 message += string.Format(CultureInfo.CurrentCulture, "{0}Expected: {1}{2}Actual: {3}", Environment.NewLine, formattedExpected, Environment.NewLine, formattedActual);
167 message += string.Format(CultureInfo.CurrentCulture, "{0}{1}\u2191 (pos {2})", newLineAndIndent, new string(' ', actualPointer), actualIndex);
230 ? string.Format(CultureInfo.CurrentCulture, "Assert.Equal() Failure: {0}", banner ?? "Values differ")
235 CultureInfo.CurrentCulture,
Sdk\Exceptions\EquivalentException.cs (14)
45 CultureInfo.CurrentCulture,
47 string.Join(", ", memberNames.Select(k => string.Format(CultureInfo.CurrentCulture, "\"{0}{1}\"", prefix, k)))
58 CultureInfo.CurrentCulture,
75 CultureInfo.CurrentCulture,
100 CultureInfo.CurrentCulture,
124 CultureInfo.CurrentCulture,
159 CultureInfo.CurrentCulture,
161 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, ": Mismatched value on member '{0}'", memberName),
189 CultureInfo.CurrentCulture,
191 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, " in member '{0}'", memberName),
224 CultureInfo.CurrentCulture,
226 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, " in member '{0}'", memberName),
252 CultureInfo.CurrentCulture,
254 Assert.GuardArgumentNotNull(nameof(memberName), memberName).Length == 0 ? string.Empty : string.Format(CultureInfo.CurrentCulture, " in member '{0}'", memberName),
Sdk\Exceptions\NotEqualException.cs (6)
94 ? string.Format(CultureInfo.CurrentCulture, "Assert.NotEqual() Failure: {0} are equal", collectionDisplay ?? "Collections")
98 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2193 (pos {2})", Environment.NewLine, new string(' ', expectedPointer.Value), mismatchedIndex);
100 message += string.Format(CultureInfo.CurrentCulture, "{0}Expected: Not {1}{2}Actual: {3}", Environment.NewLine, expected, Environment.NewLine, actual);
103 message += string.Format(CultureInfo.CurrentCulture, "{0} {1}\u2191 (pos {2})", Environment.NewLine, new string(' ', actualPointer.Value), mismatchedIndex);
152 ? string.Format(CultureInfo.CurrentCulture, "Assert.NotEqual() Failure: {0}", banner ?? "Values are equal")
157 CultureInfo.CurrentCulture,
xunit.console (2)