2 types derived from CultureInfo
System.Windows.Forms.Tests (1)
System.Xaml.Tests (1)
482 instantiations of CultureInfo
aspire (1)
Aspire.Dashboard (1)
Aspire.Dashboard.Components.Tests (2)
Aspire.Dashboard.Tests (6)
Aspire.Hosting (1)
Aspire.Hosting.Tests (4)
Aspire.TestUtilities (2)
BasicWebSite (2)
dotnet-svcutil.xmlserializer (1)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (1)
Infrastructure.Common (1)
InteractiveHost.UnitTests (1)
InteractiveHost32 (2)
InteractiveHost64 (2)
LocalizationSample (16)
LocalizationWebsite (12)
Microsoft.AspNetCore.Components.Tests (3)
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
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.AspNetCore.OpenApi.Tests (2)
Microsoft.Build.Framework (2)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit.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.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.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)
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)
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 (14)
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 (8)
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)
10815 references to CultureInfo
aspire (335)
Backchannel\ExtensionBackchannel.cs (8)
174throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.InvalidSocketPath, endpoint));
226string.Format(CultureInfo.CurrentCulture, ErrorStrings.ExtensionIncompatibleWithCli,
242string.Format(CultureInfo.CurrentCulture, ErrorStrings.ExtensionIncompatibleWithCli,
435throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
465throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
489throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
515throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
541throw new ExtensionOperationCanceledException(string.Format(CultureInfo.CurrentCulture, ErrorStrings.NoSelectionMade, promptText));
Certificates\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, s_macOSAddCertificateToKeyChainCommandLineArgumentsFormat, certificatePath, password))
Commands\AddCommand.cs (6)
242InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageInstallationFailed, ExitCodeConstants.FailedToAddPackage, ExecutionContext.LogFilePath));
246InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.PackageAddedSuccessfully, selectedNuGetPackage.Package.Id, selectedNuGetPackage.Package.Version));
270var errorMessage = string.Format(CultureInfo.CurrentCulture, AddCommandStrings.ErrorOccurredWhileAddingPackage, ex.Message);
318InteractionService.DisplaySubtleMessage(string.Format(CultureInfo.CurrentCulture, AddCommandStrings.NoPackagesMatchedSearchTerm, searchTerm));
371string.Format(CultureInfo.CurrentCulture, AddCommandStrings.SelectAVersionOfPackage, firstPackage.Package.Id),
438string.Format(CultureInfo.CurrentCulture, AddCommandStrings.SelectAVersionOfPackage, firstPackage.Package.Id),
Commands\ConfigCommand.cs (9)
113InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
184? string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeySetGlobally, key,
186: string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeySetLocally, key,
193var errorMessage = string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorSettingConfiguration, ex.Message);
361InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
384InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedGlobally, key));
388InteractionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, ConfigCommandStrings.ConfigurationKeyDeletedLocally, key));
395InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, ErrorStrings.ConfigurationKeyNotFound, key));
401var errorMessage = string.Format(CultureInfo.CurrentCulture, ErrorStrings.ErrorDeletingConfiguration, ex.Message);
Commands\ExecCommand.cs (5)
246InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, RunCommandStrings.ProjectCouldNotBeRun, ExecutionContext.LogFilePath));
257InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, RunCommandStrings.ProjectCouldNotBeRun, ExecutionContext.LogFilePath));
280var errorMessage = string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message);
287var errorMessage = string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message);
295var errorMessage = string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message);
Commands\RunCommand.cs (8)
249InteractionService.DisplayError(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ProjectCouldNotBeBuilt, ExecutionContext.LogFilePath));
382var errorMessage = string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message);
389var errorMessage = string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ErrorConnectingToAppHost, ex.Message);
393InteractionService.DisplayMessage(KnownEmojis.PageFacingUp, string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.SeeLogsAt, ExecutionContext.LogFilePath));
398var errorMessage = string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.UnexpectedErrorOccurred, ex.Message);
402InteractionService.DisplayMessage(KnownEmojis.PageFacingUp, string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.SeeLogsAt, ExecutionContext.LogFilePath));
510new Text(pid.Value.ToString(CultureInfo.InvariantCulture)));
539var timestamp = entry.Timestamp.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture);
Commands\Sdk\SdkDumpCommand.cs (25)
265var loc = string.IsNullOrEmpty(d.Location) ? "" : string.Format(CultureInfo.InvariantCulture, " [{0}]", d.Location);
266sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0}: {1}{2}", d.Severity.ToLowerInvariant(), d.Message, loc));
288var flagStr = flags.Count > 0 ? string.Format(CultureInfo.InvariantCulture, " [{0}]", string.Join(", ", flags)) : "";
289sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0}{1}", t.AtsTypeId, flagStr));
303sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}{1}: {2}", p.Name, optional, p.Type?.TypeId ?? "unknown"));
315sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0} = {1}", t.TypeId, string.Join(" | ", t.Values)));
327return string.Format(CultureInfo.InvariantCulture, "{0}{1}: {2}", p.Name, optional, p.Type?.TypeId ?? "unknown");
330sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0}({1}) -> {2}", c.CapabilityId, paramStr, returnStr));
350sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Handle Types: {0}", capabilities.HandleTypes.Count));
351sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " DTO Types: {0}", capabilities.DtoTypes.Count));
352sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Enum Types: {0}", capabilities.EnumTypes.Count));
353sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Capabilities: {0}", capabilities.Capabilities.Count));
356sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " Diagnostics: {0} errors, {1} warnings", errorCount, warningCount));
368sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0} {1}", icon, d.Message));
371sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " -> {0}", d.Location));
395var flagStr = flags.Count > 0 ? string.Format(CultureInfo.InvariantCulture, " ({0})", string.Join(", ", flags)) : "";
401sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}{1}", shortName, flagStr));
412sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", t.Name));
419sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " - {0}{1}: {2}", p.Name, optional, simpleType));
432sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", t.Name));
433sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", string.Join(" | ", t.Values)));
449sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " [{0}]", group.Key));
456return string.Format(CultureInfo.InvariantCulture, "{0}{1}: {2}", p.Name, optional, simpleType);
459sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}({1}) -> {2}", c.MethodName, paramStr, returnType));
462sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", c.Description));
Commands\TelemetryTracesCommand.cs (5)
131_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TelemetryCommandStrings.TraceNotFound, traceId));
160_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TelemetryCommandStrings.FailedToFetchTelemetry, ex.Message));
199additionalParams.Add(("limit", limit.Value.ToString(CultureInfo.InvariantCulture)));
234_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TelemetryCommandStrings.FailedToFetchTelemetry, ex.Message));
305table.AddRow(timestamp, nameMarkup, info.SpanCount.ToString(CultureInfo.InvariantCulture), durationStr, statusText);
Commands\WaitCommand.cs (7)
78_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.InvalidStatusValue, status));
93string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.SelectAppHost, WaitCommandStrings.SelectAppHostAction),
122string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.WaitingForResource, resourceName, statusLabel),
134_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.ResourceNotFound, resourceName));
140_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.WaitTimedOut, resourceName, statusLabel, timeoutSeconds));
145_interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.ResourceEnteredFailedState, resourceName, response.State ?? response.ErrorMessage));
155_interactionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, WaitCommandStrings.ResourceReachedTargetStatus, resourceName, statusLabel, elapsed.TotalSeconds));
Interaction\ConsoleInteractionService.cs (5)
178throw new EmptyChoicesException(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.NoItemsAvailableForSelection, promptText));
207throw new EmptyChoicesException(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.NoItemsAvailableForSelection, promptText));
355_errorConsole.MarkupLine(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.NewCliVersionAvailable, newerVersion.EscapeMarkup()));
359_errorConsole.MarkupLine(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.ToUpdateRunCommand, updateCommand.EscapeMarkup()));
362_errorConsole.MarkupLine(string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.MoreInfoNewCliVersion, UpdateUrl));
Projects\ProjectLocator.cs (3)
103interactionService.DisplayMessage(KnownEmojis.Warning, string.Format(CultureInfo.CurrentCulture, ErrorStrings.ProjectFileMayBeUnbuildableAppHost, relativePath));
150interactionService.DisplayMessage(KnownEmojis.Warning, string.Format(CultureInfo.CurrentCulture, ErrorStrings.AppHostWasSpecifiedButDoesntExist, settingsFile.FullName, qualifiedAppHostPath));
328interactionService.DisplayMessage(KnownEmojis.FileCabinet, string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.CreatedSettingsFile, $"[bold]'{relativeSettingsFilePath.EscapeMarkup()}'[/]"), allowMarkup: true);
Projects\ProjectUpdater.cs (25)
129interactionService.DisplaySubtleMessage(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.ExecutingUpdateStepFormat, updateStep.Description));
191throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.FailedFetchItemsAndPropertiesFormat, projectFile.FullName));
234var appHostProjectAnalyzeStep = new AnalyzeStep(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.AnalyzeProjectFormat, context.AppHostProjectFile.FullName), () => AnalyzeProjectAsync(context.AppHostProjectFile, context, cancellationToken));
254return latestPackage ?? throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.NoPackageFoundFormat, packageId, context.Channel.Name));
280string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.UpdatePackageFormat, "Aspire.AppHost.Sdk", sdkVersion ?? "unknown", latestSdkPackage?.Version),
384interactionService.DisplaySubtleMessage(string.Format(CultureInfo.InvariantCulture,
399throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture,
414throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindRootProjectElementFormat, projectFile.FullName));
432throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindSdkElementFormat, projectFile.FullName));
563CultureInfo.InvariantCulture,
583throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture,
639context.AnalyzeSteps.Enqueue(new AnalyzeStep(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.AnalyzeProjectFormat, referencedProjectFile.FullName), () => AnalyzeProjectAsync(referencedProjectFile, context, cancellationToken)));
722string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.UpdatePackageFormat, packageId, packageVersion, latestPackage!.Version),
752string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.UpdatePackageFormat, packageId, currentVersion, latestPackage!.Version),
788throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture,
795throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture,
869throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindPackageVersionInDirectoryPackagesProps, packageId, directoryPackagesPropsFile.FullName));
890throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.FailedUpdatePackageReferenceFormat, package.Id, projectFile.FullName));
1045interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.AddedFeedFormat, feed.Value));
1052interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.MappingAddedFormat, pattern));
1061interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.RemovedFeedFormat, feed.Value));
1068interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.RetainedFeedFormat, feed.Value));
1076interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.MappingAddedFormat, pattern));
1082interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.MappingRemovedFormat, pattern));
1096interactionService.DisplayPlainText(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.MappingRetainedFormat, pattern));
Resources\SecretCommandStrings.Designer.cs (17)
10internal static string Description => s_resourceManager.GetString("Description", System.Globalization.CultureInfo.CurrentUICulture) ?? "Manage AppHost user secrets.";
11internal static string SetDescription => s_resourceManager.GetString("SetDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "Set a secret value.";
12internal static string GetDescription => s_resourceManager.GetString("GetDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "Get a secret value.";
13internal static string ListDescription => s_resourceManager.GetString("ListDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "List all secrets.";
14internal static string DeleteDescription => s_resourceManager.GetString("DeleteDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "Delete a secret.";
15internal static string KeyArgumentDescription => s_resourceManager.GetString("KeyArgumentDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "The secret key.";
16internal static string KeyRetrieveArgumentDescription => s_resourceManager.GetString("KeyRetrieveArgumentDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "The secret key to retrieve.";
17internal static string KeyDeleteArgumentDescription => s_resourceManager.GetString("KeyDeleteArgumentDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "The secret key to delete.";
18internal static string ValueArgumentDescription => s_resourceManager.GetString("ValueArgumentDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "The secret value to set.";
19internal static string FormatOptionDescription => s_resourceManager.GetString("FormatOptionDescription", System.Globalization.CultureInfo.CurrentUICulture) ?? "Output format.";
20internal static string CouldNotFindAppHost => s_resourceManager.GetString("CouldNotFindAppHost", System.Globalization.CultureInfo.CurrentUICulture) ?? "Could not find an AppHost project.";
21internal static string SecretNotFound => s_resourceManager.GetString("SecretNotFound", System.Globalization.CultureInfo.CurrentUICulture) ?? "Secret '{0}' not found.";
22internal static string SecretSetSuccess => s_resourceManager.GetString("SecretSetSuccess", System.Globalization.CultureInfo.CurrentUICulture) ?? "Secret '{0}' set successfully.";
23internal static string SecretDeleteSuccess => s_resourceManager.GetString("SecretDeleteSuccess", System.Globalization.CultureInfo.CurrentUICulture) ?? "Secret '{0}' deleted successfully.";
24internal static string NoSecretsConfigured => s_resourceManager.GetString("NoSecretsConfigured", System.Globalization.CultureInfo.CurrentUICulture) ?? "No secrets configured.";
25internal static string KeyColumnHeader => s_resourceManager.GetString("KeyColumnHeader", System.Globalization.CultureInfo.CurrentUICulture) ?? "Key";
26internal static string ValueColumnHeader => s_resourceManager.GetString("ValueColumnHeader", System.Globalization.CultureInfo.CurrentUICulture) ?? "Value";
src\Shared\FormatHelpers.cs (11)
37private static MillisecondFormatStrings GetMillisecondFormatStrings(CultureInfo cultureInfo)
74private static MillisecondFormatString GetLongTimePatternWithMilliseconds(CultureInfo cultureInfo) => GetMillisecondFormatStrings(cultureInfo).LongTimePattern;
76private static MillisecondFormatString GetShortDateLongTimePatternWithMilliseconds(CultureInfo cultureInfo) => GetMillisecondFormatStrings(cultureInfo).ShortDateLongTimePattern;
84.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture);
87public static string FormatTime(TimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
89cultureInfo ??= CultureInfo.CurrentCulture;
102public static string FormatDateTime(TimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
104cultureInfo ??= CultureInfo.CurrentCulture;
117public static string FormatTimeWithOptionalDate(TimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
135public static string FormatNumberWithOptionalDecimalPlaces(double value, int maxDecimalPlaces, CultureInfo? provider = null)
147return value.ToString(formatString, provider ?? CultureInfo.CurrentCulture);
Templating\DotNetTemplateFactory.cs (6)
382interactionService.DisplayMessage(KnownEmojis.CheckMark, string.Format(CultureInfo.CurrentCulture, TemplatingStrings.PromptForTFM_UsingForTesting, testFramework));
532interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.TemplateInstallationFailed, templateInstallResult.ExitCode, executionContext.LogFilePath));
536interactionService.DisplayMessage(KnownEmojis.Package, string.Format(CultureInfo.CurrentCulture, TemplatingStrings.UsingProjectTemplatesVersion, templateInstallResult.TemplateVersion));
571interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.ProjectCreationFailed, newProjectExitCode, executionContext.LogFilePath));
582interactionService.DisplaySuccess(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.ProjectCreatedSuccessfully, outputPath));
593interactionService.DisplayError(string.Format(CultureInfo.CurrentCulture, TemplatingStrings.CertificateTrustError, ex.Message));
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Cli.Tests (4)
Aspire.Confluent.Kafka (1)
Aspire.Dashboard (171)
Components\Pages\Traces.razor.cs (7)
113var tooltip = string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesFullName)], trace.FullName);
114tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTraceId)], trace.TraceId);
124var tooltip = string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesResourceSpans)], GetResourceName(resourceSpans.Resource));
125tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTotalTraces)], count);
128tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTotalErroredTraces)], errorCount);
145string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.MessageExceededLimitBody)], DashboardOptions.Value.TelemetryLimits.MaxTraceCount),
296CultureInfo.CurrentCulture,
Model\DashboardCommandExecutor.cs (3)
108Title = string.Format(CultureInfo.InvariantCulture, loc[nameof(Dashboard.Resources.Resources.ResourceCommandStarting)], messageResourceName, command.GetDisplayName()),
148toastParameters.Title = string.Format(CultureInfo.InvariantCulture, loc[nameof(Dashboard.Resources.Resources.ResourceCommandSuccess)], messageResourceName, command.GetDisplayName());
163toastParameters.Title = string.Format(CultureInfo.InvariantCulture, loc[nameof(Dashboard.Resources.Resources.ResourceCommandFailed)], messageResourceName, command.GetDisplayName());
src\Shared\FormatHelpers.cs (11)
37private static MillisecondFormatStrings GetMillisecondFormatStrings(CultureInfo cultureInfo)
74private static MillisecondFormatString GetLongTimePatternWithMilliseconds(CultureInfo cultureInfo) => GetMillisecondFormatStrings(cultureInfo).LongTimePattern;
76private static MillisecondFormatString GetShortDateLongTimePatternWithMilliseconds(CultureInfo cultureInfo) => GetMillisecondFormatStrings(cultureInfo).ShortDateLongTimePattern;
84.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture);
87public static string FormatTime(TimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
89cultureInfo ??= CultureInfo.CurrentCulture;
102public static string FormatDateTime(TimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
104cultureInfo ??= CultureInfo.CurrentCulture;
117public static string FormatTimeWithOptionalDate(TimeProvider timeProvider, DateTime value, MillisecondsDisplay millisecondsDisplay = MillisecondsDisplay.None, CultureInfo? cultureInfo = null)
135public static string FormatNumberWithOptionalDecimalPlaces(double value, int maxDecimalPlaces, CultureInfo? provider = null)
147return value.ToString(formatString, provider ?? CultureInfo.CurrentCulture);
Aspire.Dashboard.Components.Tests (21)
Aspire.Dashboard.Tests (50)
DurationFormatterTests.cs (21)
32Assert.Equal("1μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(1 * TimeSpan.TicksPerMicrosecond), CultureInfo.CurrentCulture));
39Assert.Equal("10d 14h", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
46Assert.Equal("2d", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
53Assert.Equal(2.36m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
60Assert.Equal(2.36m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
67Assert.Equal("2m 31s", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
74Assert.Equal("2h 31m", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
81Assert.Equal(0.92m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
88Assert.Equal(0.92m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
95Assert.Equal(0.1m.ToString("0.##μs", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks((long)input), CultureInfo.CurrentCulture));
102Assert.Equal("0μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input), CultureInfo.CurrentCulture));
115var result = DurationFormatter.FormatDuration(TimeSpan.FromSeconds(seconds), CultureInfo.InvariantCulture);
159CultureInfo.InvariantCulture,
179CultureInfo.InvariantCulture,
193var defaultResult = DurationFormatter.FormatDuration(duration, CultureInfo.InvariantCulture);
194var explicitOptionalResult = DurationFormatter.FormatDuration(duration, CultureInfo.InvariantCulture, DecimalDurationDisplay.Optional);
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);
97Assert.True(DateTime.TryParseExact(value, "o", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out var date));
Aspire.Deployment.EndToEnd.Tests (1)
Aspire.EndToEnd.Tests (3)
Aspire.Hosting (98)
ApplicationModel\RequiredCommandValidator.cs (7)
103(not null, not null) => string.Format(CultureInfo.CurrentCulture, MessageStrings.RequiredCommandValidationFailedWithLink, command, validationMessage, link),
104(not null, null) => string.Format(CultureInfo.CurrentCulture, MessageStrings.RequiredCommandNotFoundWithLink, command, link),
105_ => string.Format(CultureInfo.CurrentCulture, MessageStrings.RequiredCommandNotFound, command)
112(not null, not null) => string.Format(CultureInfo.CurrentCulture, MessageStrings.RequiredCommandValidationFailed, command, validationMessage),
113(not null, null) => string.Format(CultureInfo.CurrentCulture, MessageStrings.RequiredCommandNotFound, command),
114_ => string.Format(CultureInfo.CurrentCulture, MessageStrings.RequiredCommandNotFound, command)
118_logger.LogWarning("{Message}", string.Format(CultureInfo.CurrentCulture, MessageStrings.ResourceMayFailToStart, resource.Name, message));
Pipelines\DistributedApplicationPipeline.cs (16)
878sb.AppendLine(CultureInfo.InvariantCulture, $"Total steps defined: {allSteps.Count}");
898sb.AppendLine(CultureInfo.InvariantCulture, $"{i + 1,3}. {step.Name}");
911sb.AppendLine(CultureInfo.InvariantCulture, $"Step: {step.Name}");
916sb.AppendLine(CultureInfo.InvariantCulture, $" Description: {step.Description}");
942sb.AppendLine(CultureInfo.InvariantCulture, $" Resource: {step.Resource.Name} ({step.Resource.GetType().Name})");
949sb.AppendLine(CultureInfo.InvariantCulture, $" Tags: {string.Join(", ", sortedTags)}");
971sb.AppendLine(CultureInfo.InvariantCulture, $"WARNING: Step '{step.Name}' depends on missing step '{dep}'");
989sb.AppendLine(CultureInfo.InvariantCulture, $" - {step.Name}");
1009sb.AppendLine(CultureInfo.InvariantCulture, $"If targeting '{targetStep.Name}':");
1015sb.AppendLine(CultureInfo.InvariantCulture, $" Direct dependencies: {string.Join(", ", sortedDeps)}");
1033sb.AppendLine(CultureInfo.InvariantCulture, $" Total steps: {stepsForTarget.Count}");
1048sb.AppendLine(CultureInfo.InvariantCulture, $" [{level}] {stepsAtLevel[0]}");
1053sb.AppendLine(CultureInfo.InvariantCulture, $" [{level}] {parallelSteps} (parallel)");
1200sb.AppendLine(CultureInfo.InvariantCulture, $"Pipeline with {_steps.Count} step(s):");
1204sb.Append(CultureInfo.InvariantCulture, $" - {step.Name}");
1208sb.Append(CultureInfo.InvariantCulture, $" [depends on: {string.Join(", ", step.DependsOnSteps)}]");
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.AppContainers (1)
Aspire.Hosting.Azure.AppService (2)
Aspire.Hosting.Azure.ContainerRegistry (3)
Aspire.Hosting.Azure.CosmosDB (1)
Aspire.Hosting.Azure.Functions (5)
Aspire.Hosting.Azure.Tests (1)
Aspire.Hosting.CodeGeneration.Go (2)
Aspire.Hosting.CodeGeneration.Java (2)
Aspire.Hosting.CodeGeneration.Python (6)
Aspire.Hosting.CodeGeneration.Rust (2)
Aspire.Hosting.CodeGeneration.TypeScript (1)
Aspire.Hosting.DevTunnels (18)
DevTunnelCli.cs (6)
109.AddIfNotNull("--port-number", portNumber?.ToString(CultureInfo.InvariantCulture))
124.AddIfNotNull("--port-number", portNumber?.ToString(CultureInfo.InvariantCulture))
146.AddIfNotNull("--port-number", portNumber?.ToString(CultureInfo.InvariantCulture))
181.Add("--port-number", portNumber.ToString(CultureInfo.InvariantCulture))
200.Add("--port-number", portNumber.ToString(CultureInfo.InvariantCulture))
215=> RunAsync(["port", "delete", tunnelId, "--port-number", portNumber.ToString(CultureInfo.InvariantCulture), "--json", "--nologo"], outputWriter, errorWriter, logger, cancellationToken);
DevTunnelHealthCheck.cs (4)
31return HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelUnhealthy_NoActiveHostConnections, _tunnelResource.TunnelId));
41return HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelUnhealthy_PortInactive, _tunnelResource.TunnelId, portResource.TargetEndpoint.Port));
56return HealthCheckResult.Healthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelHealthy, _tunnelResource.TunnelId, tunnelStatus.HostConnections, tunnelStatus.Ports?.Count));
73return HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelUnhealthy_Error, _tunnelResource.TunnelId, ex.Message), ex);
DevTunnelPortHealthCheck.cs (5)
22return Task.FromResult(HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelPortUnhealthy_StatusUnknown, _port, _tunnelResource.TunnelId)));
27return Task.FromResult(HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelUnhealthy_NoActiveHostConnections, _tunnelResource.TunnelId)));
35return Task.FromResult(HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelUnhealthy_PortInactive, _tunnelResource.TunnelId, _port)));
38return Task.FromResult(HealthCheckResult.Healthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelPortHealthy, _port, _tunnelResource.TunnelId)));
42return Task.FromResult(HealthCheckResult.Unhealthy(string.Format(CultureInfo.CurrentCulture, Resources.MessageStrings.DevTunnelPortUnhealthy_Error, _port, _tunnelResource.TunnelId, ex.Message), ex));
Aspire.Hosting.Docker (6)
Aspire.Hosting.Garnet (1)
Aspire.Hosting.JavaScript (2)
Aspire.Hosting.JavaScript.Tests (2)
Aspire.Hosting.Kubernetes (6)
Aspire.Hosting.Maui (2)
Aspire.Hosting.MongoDB (1)
Aspire.Hosting.Redis (2)
Aspire.Hosting.SqlServer (1)
Aspire.Hosting.Testing (6)
DistributedApplicationHostingTestingExtensions.cs (4)
51throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ResourceDoesNotExposeConnectionStringExceptionMessage, resourceName), nameof(resourceName));
102throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ResourceNotFoundExceptionMessage, resourceName), nameof(resourceName));
113throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Properties.Resources.ResourceHasNoAllocatedEndpointsExceptionMessage, resourceName), nameof(resourceName));
128throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Properties.Resources.EndpointForResourceNotFoundExceptionMessage, endpointName, resourceName), nameof(endpointName));
Aspire.Hosting.Testing.Tests (2)
Aspire.Hosting.Tests (47)
Dcp\DcpExecutorTests.cs (11)
358Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
391Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
447Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
481Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
515Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1000Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1035Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1115Assert.Equal(desiredPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1151Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1188Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
1225Assert.Equal(desiredTargetPort, int.Parse(envVarVal, CultureInfo.InvariantCulture));
Aspire.Hosting.Valkey (2)
Aspire.Playground.Tests (2)
Aspire.StackExchange.Redis (1)
Aspire.Templates.Tests (3)
Aspire.TestUtilities (19)
aspire-managed (6)
aspire-server (6)
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)
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.GetDisplayText(), 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)
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.GetDisplayText(), 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.GetDisplayText(), 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.GetDisplayText(), 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.GetDisplayText(), 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 (454)
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)
353throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrInvalidOperationNoProjectFileFoundUnderFolderFormat, workingDirectory));
358var moreThanOneProjectMsg = string.Format(CultureInfo.CurrentCulture, SR.ErrMoreThanOneProjectFoundFormat, workingDirectory);
362var useProjectOptions = string.Format(CultureInfo.CurrentCulture, SR.UseProjectFileOptionOnMultipleFilesMsgFormat, Switches.ProjectFile.Name, projectItems);
447throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrOutputFileAlreadyExistsFormat, filePath, Switches.OutputFile.Name));
454string.Format(CultureInfo.CurrentCulture, SR.ErrOutputFileNotUnderOutputDirFormat, Switches.OutputFile.Name, outputFile, this.OutputDir, Switches.OutputDirectory.Name));
460this.AddWarning(string.Format(CultureInfo.CurrentCulture, SR.WrnSpecifiedFilePathNotUndeProjectDirFormat, Switches.OutputFile.Name, outputFile, this.Project.DirectoryPath));
480throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrInvalidOperationNoProjectFileFoundUnderFolderFormat, Directory.GetCurrentDirectory()));
484throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrProjectToUpdateNotFoundFormat, Switches.Update.Name, Switches.ProjectFile.Name));
515throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrNoUpdateParamsFileFoundFormat, this.Project.FullPath));
523throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrMoreThanOneUpdateParamsFilesFoundFormat, this.Project.FullPath, Switches.Update.Name, svcRefNames));
537throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrServiceReferenceNotFoundUnderProjectFormat, this.UpdateServiceReferenceFolder, this.Project.FullPath));
545throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrNoUpdateParamsFileFoundFormat, this.Project.FullPath));
582var sessionDirName = DateTime.Now.ToString("yyyy_MMM_dd_HH_mm_ss", CultureInfo.InvariantCulture);
669throw new ToolArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ErrInvalidNamespaceFormat,
680this.Project.EndOfLifeTargetFrameworks?.ToList().ForEach(tfx => this.AddWarning(string.Format(CultureInfo.CurrentCulture, SR.WrnOutOfSupportTargetFrameworkFormat, tfx)));
686this.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)
95s_helpBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}", syntax));
96s_helpBuilder.AppendLine(paragraphHelper.AddIndentation(string.Format(CultureInfo.InvariantCulture, " {0}", explanation), indentLength: 4));
119_name = String.Format(CultureInfo.InvariantCulture, "{0}{1}", CommandSwitch.FullSwitchIndicator, option),
129_name = String.Format(CultureInfo.InvariantCulture, "{0}{1} {2}", CommandSwitch.FullSwitchIndicator, option, optionUse),
156return 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.GetDisplayText(), 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.GetDisplayText(), 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 (16)
GenerateRulesMissingDocumentation (1)
GenericHostWebSite (3)
GetDocument.Insider (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.GetDisplayText(), 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)
IIS.Common.TestLib (1)
IIS.FunctionalTests (32)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (6)
55stringBuilder.Append(i.ToString("X2", CultureInfo.InvariantCulture));
107Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
117var response = await SendSocketRequestAsync("/%" + i.ToString("X2", CultureInfo.InvariantCulture));
118Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
801var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
808var 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.ShadowCopy.Tests (7)
IISExpress.FunctionalTests (30)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (6)
55stringBuilder.Append(i.ToString("X2", CultureInfo.InvariantCulture));
107Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
117var response = await SendSocketRequestAsync("/%" + i.ToString("X2", CultureInfo.InvariantCulture));
118Assert.True(string.Equals(400, response.Status), i.ToString("X2", CultureInfo.InvariantCulture) + ";" + response);
801var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
808var 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)
241/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo)"/></item>
242/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
249/// <item><see cref="System.Activator.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
257/// <item><see cref="System.Activator.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
265/// <item><see cref="System.AppDomain.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
273/// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
281/// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
289/// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
298/// <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 (13)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (9)
241/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo)"/></item>
242/// <item><see cref="System.Activator.CreateInstance(System.Type, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
249/// <item><see cref="System.Activator.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
257/// <item><see cref="System.Activator.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
265/// <item><see cref="System.AppDomain.CreateInstance(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
273/// <item><see cref="System.AppDomain.CreateInstanceAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
281/// <item><see cref="System.AppDomain.CreateInstanceFrom(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
289/// <item><see cref="System.AppDomain.CreateInstanceFromAndUnwrap(string, string, bool, System.Reflection.BindingFlags, System.Reflection.Binder, object[], System.Globalization.CultureInfo, object[])"/></item>
298/// <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)
707await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
745await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
770await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
821await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
848await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform));
1003await Host.ResetAsync(InteractiveHostOptions.CreateFromDirectory(TestUtils.HostRootPath, initializationFileName: null, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, InteractiveHostPlatform.Desktop32));
1011var result = await Host.ResetAsync(InteractiveHostOptions.CreateFromDirectory(TestUtils.HostRootPath, initializationFileName: null, CultureInfo.InvariantCulture, CultureInfo.InvariantCulture, InteractiveHostPlatform.Core));
1025var culture = new CultureInfo("cs-CZ");
1026var 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 (14)
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 (13)
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 (8)
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)
27private delegate object? BindFormatter<T>(T value, CultureInfo? culture);
29internal delegate bool BindParser<T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value);
30internal delegate bool BindParserWithFormat<T>(object? obj, CultureInfo? culture, string? format, [MaybeNullWhen(false)] out T value);
37/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
41public static string? FormatValue(string? value, CultureInfo? culture = null) => FormatStringValueCore(value, culture);
43private static string? FormatStringValueCore(string? value, CultureInfo? _)
53/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
57public static bool FormatValue(bool value, CultureInfo? culture = null)
65private static object FormatBoolValueCore(bool value, CultureInfo? _)
77/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
81public static bool? FormatValue(bool? value, CultureInfo? culture = null)
89private static object? FormatNullableBoolValueCore(bool? value, CultureInfo? _)
101/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
105public static string? FormatValue(int value, CultureInfo? culture = null) => FormatIntValueCore(value, culture);
107private static string? FormatIntValueCore(int value, CultureInfo? culture)
109return value.ToString(culture ?? CultureInfo.CurrentCulture);
117/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
121public static string? FormatValue(int? value, CultureInfo? culture = null) => FormatNullableIntValueCore(value, culture);
123private static string? FormatNullableIntValueCore(int? value, CultureInfo? culture)
130return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
138/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
142public static string FormatValue(long value, CultureInfo? culture = null) => FormatLongValueCore(value, culture);
144private static string FormatLongValueCore(long value, CultureInfo? culture)
146return value.ToString(culture ?? CultureInfo.CurrentCulture);
154/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
158public static string? FormatValue(long? value, CultureInfo? culture = null) => FormatNullableLongValueCore(value, culture);
160private static string? FormatNullableLongValueCore(long? value, CultureInfo? culture)
167return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
175/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
179public static string FormatValue(short value, CultureInfo? culture = null) => FormatShortValueCore(value, culture);
181private static string FormatShortValueCore(short value, CultureInfo? culture)
183return value.ToString(culture ?? CultureInfo.CurrentCulture);
191/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
195public static string? FormatValue(short? value, CultureInfo? culture = null) => FormatNullableShortValueCore(value, culture);
197private static string? FormatNullableShortValueCore(short? value, CultureInfo? culture)
204return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
212/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
216public static string FormatValue(float value, CultureInfo? culture = null) => FormatFloatValueCore(value, culture);
218private static string FormatFloatValueCore(float value, CultureInfo? culture)
220return value.ToString(culture ?? CultureInfo.CurrentCulture);
228/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
232public static string? FormatValue(float? value, CultureInfo? culture = null) => FormatNullableFloatValueCore(value, culture);
234private static string? FormatNullableFloatValueCore(float? value, CultureInfo? culture)
241return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
249/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
253public static string? FormatValue(double value, CultureInfo? culture = null) => FormatDoubleValueCore(value, culture);
255private static string FormatDoubleValueCore(double value, CultureInfo? culture)
257return value.ToString(culture ?? CultureInfo.CurrentCulture);
265/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
269public static string? FormatValue(double? value, CultureInfo? culture = null) => FormatNullableDoubleValueCore(value, culture);
271private static string? FormatNullableDoubleValueCore(double? value, CultureInfo? culture)
278return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
286/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
290public static string FormatValue(decimal value, CultureInfo? culture = null) => FormatDecimalValueCore(value, culture);
292private static string FormatDecimalValueCore(decimal value, CultureInfo? culture)
294return value.ToString(culture ?? CultureInfo.CurrentCulture);
302/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
306public static string? FormatValue(decimal? value, CultureInfo? culture = null) => FormatNullableDecimalValueCore(value, culture);
308private static string? FormatNullableDecimalValueCore(decimal? value, CultureInfo? culture)
315return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
323/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
327public static string FormatValue(DateTime value, CultureInfo? culture = null) => FormatDateTimeValueCore(value, format: null, culture);
335/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
339public static string FormatValue(DateTime value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, CultureInfo? culture = null) => FormatDateTimeValueCore(value, format, culture);
341private static string FormatDateTimeValueCore(DateTime value, string? format, CultureInfo? culture)
345return value.ToString(format, culture ?? CultureInfo.CurrentCulture);
348return value.ToString(culture ?? CultureInfo.CurrentCulture);
351private static string FormatDateTimeValueCore(DateTime value, CultureInfo? culture)
353return value.ToString(culture ?? CultureInfo.CurrentCulture);
361/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
365public static string? FormatValue(DateTime? value, CultureInfo? culture = null) => FormatNullableDateTimeValueCore(value, format: null, culture);
373/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
377public static string? FormatValue(DateTime? value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string? format, CultureInfo? culture = null) => FormatNullableDateTimeValueCore(value, format, culture);
379private static string? FormatNullableDateTimeValueCore(DateTime? value, string? format, CultureInfo? culture)
388return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture);
391return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
394private static string? FormatNullableDateTimeValueCore(DateTime? value, CultureInfo? culture)
401return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
409/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
413public static string FormatValue(DateTimeOffset value, CultureInfo? culture = null) => FormatDateTimeOffsetValueCore(value, format: null, culture);
421/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
425public static string FormatValue(DateTimeOffset value, string format, CultureInfo? culture = null) => FormatDateTimeOffsetValueCore(value, format, culture);
427private static string FormatDateTimeOffsetValueCore(DateTimeOffset value, string? format, CultureInfo? culture)
431return value.ToString(format, culture ?? CultureInfo.CurrentCulture);
434return value.ToString(culture ?? CultureInfo.CurrentCulture);
437private static string FormatDateTimeOffsetValueCore(DateTimeOffset value, CultureInfo? culture)
439return value.ToString(culture ?? CultureInfo.CurrentCulture);
447/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
451public static string? FormatValue(DateTimeOffset? value, CultureInfo? culture = null) => FormatNullableDateTimeOffsetValueCore(value, format: null, culture);
459/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
463public static string? FormatValue(DateTimeOffset? value, string format, CultureInfo? culture = null) => FormatNullableDateTimeOffsetValueCore(value, format, culture);
465private static string? FormatNullableDateTimeOffsetValueCore(DateTimeOffset? value, string? format, CultureInfo? culture)
474return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture);
477return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
480private static string? FormatNullableDateTimeOffsetValueCore(DateTimeOffset? value, CultureInfo? culture)
487return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
495/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
499public static string FormatValue(DateOnly value, CultureInfo? culture = null) => FormatDateOnlyValueCore(value, format: null, culture);
507/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
511public static string FormatValue(DateOnly value, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, CultureInfo? culture = null) => FormatDateOnlyValueCore(value, format, culture);
513private static string FormatDateOnlyValueCore(DateOnly value, string? format, CultureInfo? culture)
518return value.ToDateTime(TimeOnly.MinValue).ToString(format, culture ?? CultureInfo.CurrentCulture);
521return value.ToString(culture ?? CultureInfo.CurrentCulture);
524private static string FormatDateOnlyValueCore(DateOnly value, CultureInfo? culture)
526return value.ToString(culture ?? CultureInfo.CurrentCulture);
534/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
538public static string? FormatValue(DateOnly? value, CultureInfo? culture = null) => FormatNullableDateOnlyValueCore(value, format: null, culture);
546/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
550public static string? FormatValue(DateOnly? value, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, CultureInfo? culture = null) => FormatNullableDateOnlyValueCore(value, format, culture);
552private static string? FormatNullableDateOnlyValueCore(DateOnly? value, string? format, CultureInfo? culture)
562return value.Value.ToDateTime(TimeOnly.MinValue).ToString(format, culture ?? CultureInfo.CurrentCulture);
565return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
568private static string? FormatNullableDateOnlyValueCore(DateOnly? value, CultureInfo? culture)
575return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
583/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
587public static string FormatValue(TimeOnly value, CultureInfo? culture = null) => FormatTimeOnlyValueCore(value, format: null, culture);
595/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
599public static string FormatValue(TimeOnly value, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, CultureInfo? culture = null) => FormatTimeOnlyValueCore(value, format, culture);
601private static string FormatTimeOnlyValueCore(TimeOnly value, string? format, CultureInfo? culture)
606return DateTime.MinValue.Add(value.ToTimeSpan()).ToString(format, culture ?? CultureInfo.CurrentCulture);
609return value.ToString(culture ?? CultureInfo.CurrentCulture);
612private static string FormatTimeOnlyValueCore(TimeOnly value, CultureInfo? culture)
614return value.ToString(culture ?? CultureInfo.CurrentCulture);
622/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
626public static string? FormatValue(TimeOnly? value, CultureInfo? culture = null) => FormatNullableTimeOnlyValueCore(value, format: null, culture);
634/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
638public static string? FormatValue(TimeOnly? value, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, CultureInfo? culture = null) => FormatNullableTimeOnlyValueCore(value, format, culture);
640private static string? FormatNullableTimeOnlyValueCore(TimeOnly? value, string? format, CultureInfo? culture)
650return DateTime.MinValue.Add(value.Value.ToTimeSpan()).ToString(format, culture ?? CultureInfo.CurrentCulture);
653return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
656private static string? FormatNullableTimeOnlyValueCore(TimeOnly? value, CultureInfo? culture)
663return value.Value.ToString(culture ?? CultureInfo.CurrentCulture);
666private static string? FormatEnumValueCore<T>(T value, CultureInfo? _)
681/// The <see cref="CultureInfo"/> to use while formatting. Defaults to <see cref="CultureInfo.CurrentCulture"/>.
685public static object? FormatValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(T value, CultureInfo? culture = null)
695/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
698public static bool TryConvertToString(object? obj, CultureInfo? culture, out string? value)
705private static bool ConvertToStringCore(object? obj, CultureInfo? culture, out string? value)
716/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
719public static bool TryConvertToBool(object? obj, CultureInfo? culture, out bool value)
728/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
731public static bool TryConvertToNullableBool(object? obj, CultureInfo? culture, out bool? value)
739private static bool ConvertToBoolCore(object? obj, CultureInfo? culture, out bool value)
746private static bool ConvertToNullableBoolCore(object? obj, CultureInfo? culture, out bool? value)
757/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
760public static bool TryConvertToInt(object? obj, CultureInfo? culture, out int value)
769/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
772public static bool TryConvertToNullableInt(object? obj, CultureInfo? culture, out int? value)
780private static bool ConvertToIntCore(object? obj, CultureInfo? culture, out int value)
789if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
799private static bool ConvertToNullableIntCore(object? obj, CultureInfo? culture, out int? value)
808if (!int.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
822/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
825public static bool TryConvertToLong(object? obj, CultureInfo? culture, out long value)
834/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
837public static bool TryConvertToNullableLong(object? obj, CultureInfo? culture, out long? value)
845private static bool ConvertToLongCore(object? obj, CultureInfo? culture, out long value)
854if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
864private static bool ConvertToNullableLongCore(object? obj, CultureInfo? culture, out long? value)
873if (!long.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
887/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
890public static bool TryConvertToShort(object? obj, CultureInfo? culture, out short value)
899/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
902public static bool TryConvertToNullableShort(object? obj, CultureInfo? culture, out short? value)
910private static bool ConvertToShortCore(object? obj, CultureInfo? culture, out short value)
919if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
929private static bool ConvertToNullableShortCore(object? obj, CultureInfo? culture, out short? value)
938if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
952/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
955public static bool TryConvertToFloat(object? obj, CultureInfo? culture, out float value)
964/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
967public static bool TryConvertToNullableFloat(object? obj, CultureInfo? culture, out float? value)
975private static bool ConvertToFloatCore(object? obj, CultureInfo? culture, out float value)
984if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1000private static bool ConvertToNullableFloatCore(object? obj, CultureInfo? culture, out float? value)
1009if (!float.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1029/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1032public static bool TryConvertToDouble(object? obj, CultureInfo? culture, out double value)
1041/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1044public static bool TryConvertToNullableDouble(object? obj, CultureInfo? culture, out double? value)
1052private static bool ConvertToDoubleCore(object? obj, CultureInfo? culture, out double value)
1061if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1077private static bool ConvertToNullableDoubleCore(object? obj, CultureInfo? culture, out double? value)
1086if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1106/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1109public static bool TryConvertToDecimal(object? obj, CultureInfo? culture, out decimal value)
1118/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1121public static bool TryConvertToNullableDecimal(object? obj, CultureInfo? culture, out decimal? value)
1129private static bool ConvertToDecimalCore(object? obj, CultureInfo? culture, out decimal value)
1138if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1148private static bool ConvertToNullableDecimalCore(object? obj, CultureInfo? culture, out decimal? value)
1157if (!decimal.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
1171/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1174public static bool TryConvertToDateTime(object? obj, CultureInfo? culture, out DateTime value)
1183/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1187public static bool TryConvertToDateTime(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, out DateTime value)
1196/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1199public static bool TryConvertToNullableDateTime(object? obj, CultureInfo? culture, out DateTime? value)
1208/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1212public static bool TryConvertToNullableDateTime(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, out DateTime? value)
1222private static bool ConvertToDateTimeCore(object? obj, CultureInfo? culture, out DateTime value)
1227private static bool ConvertToDateTimeCore(object? obj, CultureInfo? culture, string? format, out DateTime value)
1236if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1241else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1251private static bool ConvertToNullableDateTimeCore(object? obj, CultureInfo? culture, out DateTime? value)
1256private static bool ConvertToNullableDateTimeCore(object? obj, CultureInfo? culture, string? format, out DateTime? value)
1265if (format != null && DateTime.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1270else if (format == null && DateTime.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1284/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1287public static bool TryConvertToDateTimeOffset(object? obj, CultureInfo? culture, out DateTimeOffset value)
1296/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1300public static bool TryConvertToDateTimeOffset(object? obj, CultureInfo? culture, string format, out DateTimeOffset value)
1309/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1312public static bool TryConvertToNullableDateTimeOffset(object? obj, CultureInfo? culture, out DateTimeOffset? value)
1321/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1325public static bool TryConvertToNullableDateTimeOffset(object? obj, CultureInfo? culture, string format, out DateTimeOffset? value)
1335private static bool ConvertToDateTimeOffsetCore(object? obj, CultureInfo? culture, out DateTimeOffset value)
1340private static bool ConvertToDateTimeOffsetCore(object? obj, CultureInfo? culture, string? format, out DateTimeOffset value)
1349if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1354else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1364private static bool ConvertToNullableDateTimeOffsetCore(object? obj, CultureInfo? culture, out DateTimeOffset? value)
1369private static bool ConvertToNullableDateTimeOffsetCore(object? obj, CultureInfo? culture, string? format, out DateTimeOffset? value)
1378if (format != null && DateTimeOffset.TryParseExact(text, format, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out var converted))
1383else if (format == null && DateTimeOffset.TryParse(text, culture ?? CultureInfo.CurrentCulture, DateTimeStyles.None, out converted))
1397/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1400public static bool TryConvertToDateOnly(object? obj, CultureInfo? culture, out DateOnly value)
1409/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1413public static bool TryConvertToDateOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, out DateOnly value)
1422/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1425public static bool TryConvertToNullableDateOnly(object? obj, CultureInfo? culture, out DateOnly? value)
1434/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1438public static bool TryConvertToNullableDateOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] string format, out DateOnly? value)
1448private static bool ConvertToDateOnlyCore(object? obj, CultureInfo? culture, out DateOnly value)
1453private static bool ConvertToDateOnlyCore(object? obj, CultureInfo? culture, string? format, out DateOnly value)
1466private static bool ConvertToNullableDateOnlyCore(object? obj, CultureInfo? culture, out DateOnly? value)
1471private static bool ConvertToNullableDateOnlyCore(object? obj, CultureInfo? culture, string? format, out DateOnly? value)
1488/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1491public static bool TryConvertToTimeOnly(object? obj, CultureInfo? culture, out TimeOnly value)
1500/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1504public static bool TryConvertToTimeOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, out TimeOnly value)
1513/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1516public static bool TryConvertToNullableTimeOnly(object? obj, CultureInfo? culture, out TimeOnly? value)
1525/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1529public static bool TryConvertToNullableTimeOnly(object? obj, CultureInfo? culture, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] string format, out TimeOnly? value)
1539private static bool ConvertToTimeOnlyCore(object? obj, CultureInfo? culture, out TimeOnly value)
1544private static bool ConvertToTimeOnlyCore(object? obj, CultureInfo? culture, string? format, out TimeOnly value)
1557private static bool ConvertToNullableTimeOnlyCore(object? obj, CultureInfo? culture, out TimeOnly? value)
1562private static bool ConvertToNullableTimeOnlyCore(object? obj, CultureInfo? culture, string? format, out TimeOnly? value)
1578private static bool ConvertToGuidCore(object? obj, CultureInfo? culture, out Guid value)
1585private static bool ConvertToNullableGuidCore(object? obj, CultureInfo? culture, out Guid? value)
1604private static bool ConvertToEnum<T>(object? obj, CultureInfo? _, out T value) where T : struct, Enum
1629private static bool ConvertToNullableEnum<T>(object? obj, CultureInfo? _, out T? value) where T : struct, Enum
1658/// <param name="culture">The <see cref="CultureInfo"/> to use for conversion.</param>
1661public static bool TryConvertTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value)
1818string? FormatArrayValue(T[] value, CultureInfo? culture)
1856string? FormatWithTypeConverter(T value, CultureInfo? culture)
1859return typeConverter.ConvertToString(context: null, culture ?? CultureInfo.CurrentCulture, value);
2033bool ConvertToArray(object? obj, CultureInfo? culture, out T[]? value)
2071bool ConvertWithTypeConverter(object? obj, CultureInfo? culture, out T value)
2079var 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 (24)
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");
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.Components.Endpoints.Tests (106)
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 (8)
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 (33)
Forms\InputDate.cs (6)
103DateTime dateTimeValue => BindConverter.FormatValue(dateTimeValue, _format, CultureInfo.InvariantCulture),
104DateTimeOffset dateTimeOffsetValue => BindConverter.FormatValue(dateTimeOffsetValue, _format, CultureInfo.InvariantCulture),
105DateOnly dateOnlyValue => BindConverter.FormatValue(dateOnlyValue, _format, CultureInfo.InvariantCulture),
106TimeOnly timeOnlyValue => BindConverter.FormatValue(timeOnlyValue, _format, CultureInfo.InvariantCulture),
113if (BindConverter.TryConvertTo(value, CultureInfo.InvariantCulture, out result))
121validationErrorMessage = string.Format(CultureInfo.InvariantCulture, _parsingErrorMessage, DisplayName ?? FieldIdentifier.FieldName);
Forms\InputNumber.cs (8)
71if (BindConverter.TryConvertTo<TValue>(value, CultureInfo.InvariantCulture, out result))
78validationErrorMessage = string.Format(CultureInfo.InvariantCulture, ParsingErrorMessage, DisplayName ?? FieldIdentifier.FieldName);
97return BindConverter.FormatValue(@int, CultureInfo.InvariantCulture);
100return BindConverter.FormatValue(@long, CultureInfo.InvariantCulture);
103return BindConverter.FormatValue(@short, CultureInfo.InvariantCulture);
106return BindConverter.FormatValue(@float, CultureInfo.InvariantCulture);
109return BindConverter.FormatValue(@double, CultureInfo.InvariantCulture);
112return BindConverter.FormatValue(@decimal, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Components.Web.Tests (4)
Microsoft.AspNetCore.Components.WebAssembly (14)
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Microsoft.AspNetCore.Components.WebView (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 (8)
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)
79CultureInfo.InvariantCulture,
87int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
95int hours = int.Parse(offset.AsSpan(1, 2), CultureInfo.InvariantCulture);
96int minutes = int.Parse(offset.AsSpan(4, 2), CultureInfo.InvariantCulture);
148builder.Append(dateTime.ToString("yyyy'-'MM'-'dd'T'HH:mm:ss", CultureInfo.InvariantCulture));
156builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
160builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
164builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture));
197long seconds = long.Parse(secondsText, CultureInfo.InvariantCulture) * multiplier;
202int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
229builder.Append(seconds.ToString("d", CultureInfo.InvariantCulture));
259builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
263builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
267builder.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)
79CultureInfo.InvariantCulture,
87int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
95int hours = int.Parse(offset.AsSpan(1, 2), CultureInfo.InvariantCulture);
96int minutes = int.Parse(offset.AsSpan(4, 2), CultureInfo.InvariantCulture);
148builder.Append(dateTime.ToString("yyyy'-'MM'-'dd'T'HH:mm:ss", CultureInfo.InvariantCulture));
156builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
160builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
164builder.Append(nanos.ToString("d9", CultureInfo.InvariantCulture));
197long seconds = long.Parse(secondsText, CultureInfo.InvariantCulture) * multiplier;
202int parsedFraction = int.Parse(subseconds.AsSpan(1), CultureInfo.InvariantCulture);
229builder.Append(seconds.ToString("d", CultureInfo.InvariantCulture));
259builder.Append((nanos / 1000000).ToString("d3", CultureInfo.InvariantCulture));
263builder.Append((nanos / 1000).ToString("d6", CultureInfo.InvariantCulture));
267builder.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 (18)
Microsoft.AspNetCore.Hosting.Abstractions (1)
Microsoft.AspNetCore.Hosting.FunctionalTests (1)
Microsoft.AspNetCore.Hosting.Tests (3)
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 (8)
Microsoft.AspNetCore.Http.Connections.Tests (1)
Microsoft.AspNetCore.Http.Extensions (28)
RequestDelegateFactory.cs (14)
122private static readonly ConstructorInfo FormDataReaderConstructor = typeof(FormDataReader).GetConstructor(new[] { typeof(IReadOnlyDictionary<FormKey, StringValues>), typeof(CultureInfo), typeof(Memory<char>), typeof(IFormFileCollection) })!;
1772var tryParseCall = tryParseMethodCall(parsedValue, Expression.Constant(CultureInfo.InvariantCulture));
2005converted = Convert.ChangeType(defaultValue, targetType, CultureInfo.InvariantCulture);
2191Expression.Constant(CultureInfo.InvariantCulture),
2700var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.InvalidJsonRequestBodyExceptionMessage, parameterTypeName, parameterName);
2714var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.ParameterBindingFailedExceptionMessage, parameterTypeName, parameterName, sourceValue);
2728var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.RequiredParameterNotProvidedExceptionMessage, parameterTypeName, parameterName, source);
2742var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.ImplicitBodyNotProvidedExceptionMessage, parameterName);
2756var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.UnexpectedJsonContentTypeExceptionMessage, contentType);
2770var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.UnexpectedFormContentTypeExceptionMessage, contentType);
2784var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.InvalidFormRequestBodyExceptionMessage, parameterTypeName, parameterName);
2798var message = string.Format(CultureInfo.InvariantCulture, RequestDelegateCreationLogging.InvalidAntiforgeryTokenExceptionMessage, parameterTypeName, parameterName);
2812var message = string.Format(CultureInfo.InvariantCulture, exception.Error.Message.Format, exception.Error.Message.GetArguments());
2826var 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.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 (12)
GeneratedRouteBuilderExtensions.g.cs (11)
247if (GeneratedRouteBuilderExtensionsCore.TryParseExplicit<bool>(useCookies_temp!, CultureInfo.InvariantCulture, out var useCookies_temp_parsed_non_nullable))
264if (GeneratedRouteBuilderExtensionsCore.TryParseExplicit<bool>(useSessionCookies_temp!, CultureInfo.InvariantCulture, out var useSessionCookies_temp_parsed_non_nullable))
308if (GeneratedRouteBuilderExtensionsCore.TryParseExplicit<bool>(useCookies_temp!, CultureInfo.InvariantCulture, out var useCookies_temp_parsed_non_nullable))
325if (GeneratedRouteBuilderExtensionsCore.TryParseExplicit<bool>(useSessionCookies_temp!, CultureInfo.InvariantCulture, out var useSessionCookies_temp_parsed_non_nullable))
1544var message = string.Format(CultureInfo.InvariantCulture, "Failed to read parameter \"{0} {1}\" from the request body as JSON.", parameterTypeName, parameterName);
1561var message = string.Format(CultureInfo.InvariantCulture, "Failed to bind parameter \"{0} {1}\" from \"{2}\".", parameterTypeName, parameterName, sourceValue);
1578var message = string.Format(CultureInfo.InvariantCulture, "Required parameter \"{0} {1}\" was not provided from {2}.", parameterTypeName, parameterName, source);
1595var message = string.Format(CultureInfo.InvariantCulture, "Implicit body inferred for parameter \"{0}\" but no body was provided. Did you mean to use a Service instead?", parameterName);
1612var message = string.Format(CultureInfo.InvariantCulture, "Expected a supported JSON media type but got \"{0}\".", contentType);
1629var message = string.Format(CultureInfo.InvariantCulture, "Expected a supported form media type but got \"{0}\".", contentType);
1646var message = string.Format(CultureInfo.InvariantCulture, "Failed to read parameter \"{0} {1}\" from the request body as form.", parameterTypeName, parameterName);
Microsoft.AspNetCore.Identity.EntityFrameworkCore (2)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (7)
Microsoft.AspNetCore.Identity.FunctionalTests (7)
MapIdentityApiTests.cs (6)
703var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
744var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
796var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
812var resetTwoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
843var twoFactorCode = Rfc6238AuthenticationService.ComputeTotp(keyBytes, (ulong)timestep, modifierBytes: null).ToString(CultureInfo.InvariantCulture);
912var 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))));
735return Convert.ToString(func(null), CultureInfo.InvariantCulture);
Microsoft.AspNetCore.JsonPatch.SystemTextJson (16)
JsonPatchDocumentOfT.cs (15)
86GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
141GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
200GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
262GetPath(path, position.ToString(CultureInfo.InvariantCulture)),
330GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
353GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
379GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
380GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
404GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
472GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
495GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
521GetPath(path, positionTo.ToString(CultureInfo.InvariantCulture)),
522GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
546GetPath(from, positionFrom.ToString(CultureInfo.InvariantCulture))));
750return 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 (25)
GeneratedRouteBuilderExtensions.g.cs (7)
299var message = string.Format(CultureInfo.InvariantCulture, "Failed to read parameter \"{0} {1}\" from the request body as JSON.", parameterTypeName, parameterName);
316var message = string.Format(CultureInfo.InvariantCulture, "Failed to bind parameter \"{0} {1}\" from \"{2}\".", parameterTypeName, parameterName, sourceValue);
333var message = string.Format(CultureInfo.InvariantCulture, "Required parameter \"{0} {1}\" was not provided from {2}.", parameterTypeName, parameterName, source);
350var message = string.Format(CultureInfo.InvariantCulture, "Implicit body inferred for parameter \"{0}\" but no body was provided. Did you mean to use a Service instead?", parameterName);
367var message = string.Format(CultureInfo.InvariantCulture, "Expected a supported JSON media type but got \"{0}\".", contentType);
384var message = string.Format(CultureInfo.InvariantCulture, "Expected a supported form media type but got \"{0}\".", contentType);
401var message = string.Format(CultureInfo.InvariantCulture, "Failed to read parameter \"{0} {1}\" from the request body as form.", 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.OpenApi.SourceGenerators (3)
Microsoft.AspNetCore.OpenApi.Tests (22)
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 (15)
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)
266Assert.Equal(StatusCodes.Status200OK.ToString(CultureInfo.InvariantCulture), responseStatusCode);
283Assert.Equal(StatusCodes.Status400BadRequest.ToString(CultureInfo.InvariantCulture), responseStatusCode);
338stringBuilder.Append(i.ToString("X2", CultureInfo.InvariantCulture));
475Assert.True(string.Equals("400", responseStatusCode), i.ToString("X2", CultureInfo.InvariantCulture));
491var response = await SendSocketRequestAsync(root, "/%" + i.ToString("X2", CultureInfo.InvariantCulture));
493Assert.True(string.Equals("400", responseStatusCode), i.ToString("X2", CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Server.IIS (7)
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 (35)
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.GetDisplayText(), 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 (9)
StaticAssetsIntegrationTests.cs (9)
627new("Content-Length", resource.Content.Length.ToString(CultureInfo.InvariantCulture)),
630new("Last-Modified", lastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)),
650new ("Content-Length", length.ToString(CultureInfo.InvariantCulture)),
652new ("Last-Modified", lastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)),
705new("Content-Length", "Hello, World!".Length.ToString(CultureInfo.InvariantCulture)),
708new("Last-Modified", new DateTimeOffset(2023,03,03,0,0,0,TimeSpan.Zero).ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture))
1050req2.Headers.TryAddWithoutValidation("If-Modified-Since", DateTimeOffset.UtcNow.ToString(format, CultureInfo.InvariantCulture));
1258var httpFormatted = original.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture);
1259var parsed = DateTimeOffset.Parse(httpFormatted, 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 (11)
Microsoft.AspNetCore.WebUtilities.Tests (1)
Microsoft.Build.Framework (33)
Microsoft.Build.Tasks.CodeAnalysis (12)
src\Compilers\Core\MSBuildTask\Csc.cs (3)
679if (!string.IsNullOrEmpty(PreferredUILang) && !string.Equals(PreferredUILang, System.Globalization.CultureInfo.CurrentUICulture.Name, StringComparison.OrdinalIgnoreCase))
708Log.LogError(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
712Log.LogWarning(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (15)
src\Compilers\Core\MSBuildTask\Csc.cs (3)
679if (!string.IsNullOrEmpty(PreferredUILang) && !string.Equals(PreferredUILang, System.Globalization.CultureInfo.CurrentUICulture.Name, StringComparison.OrdinalIgnoreCase))
708Log.LogError(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
712Log.LogWarning(null, "CS" + errorCode.ToString("D4", CultureInfo.InvariantCulture), null, null, 0, 0, 0, 0, errorMessage);
Microsoft.Cci.Extensions (2)
Microsoft.CodeAnalysis (104)
CommandLine\ReportAnalyzerUtil.cs (6)
22CultureInfo culture,
43public static string GetFormattedAnalyzerExecutionTime(double executionTime, CultureInfo culture) =>
48public static string GetFormattedAnalyzerExecutionPercentage(int percentage, CultureInfo culture) =>
58private static string GetColumnEntry(double totalSeconds, int percentage, string? name, CultureInfo culture)
66private static void ReportAnalyzerExecutionTime(TextWriter consoleOutput, AnalyzerDriver analyzerDriver, CultureInfo culture)
149private static void ReportGeneratorExecutionTime(TextWriter consoleOutput, GeneratorDriverTimingInfo driverTimingInfo, CultureInfo culture)
Microsoft.CodeAnalysis.Analyzers (15)
Microsoft.CodeAnalysis.AnalyzerUtilities (8)
Microsoft.CodeAnalysis.BannedApiAnalyzers (10)
Microsoft.CodeAnalysis.CodeStyle (11)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (113)
SymbolDisplay\ObjectDisplay.cs (14)
357internal static string FormatLiteral(sbyte value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
371internal static string FormatLiteral(byte value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
383internal static string FormatLiteral(short value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
397internal static string FormatLiteral(ushort value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
409internal static string FormatLiteral(int value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
421internal static string FormatLiteral(uint value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
444internal static string FormatLiteral(long value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
467internal static string FormatLiteral(ulong value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
490internal static string FormatLiteral(double value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
497internal static string FormatLiteral(float value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
504internal static string FormatLiteral(decimal value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
511private static CultureInfo GetFormatCulture(CultureInfo? cultureInfo)
513return cultureInfo ?? CultureInfo.InvariantCulture;
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (216)
CommandLineTests.cs (182)
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);
1867var originalCulture = Thread.CurrentThread.CurrentCulture;
1878var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2252var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2284var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2313var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2456var output = new StringWriter(CultureInfo.InvariantCulture);
2787var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2810var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2926var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2962var outWriter = new StringWriter(CultureInfo.InvariantCulture);
2995var outWriter = new StringWriter(CultureInfo.InvariantCulture);
3007outWriter = new StringWriter(CultureInfo.InvariantCulture);
3514var outWriter = new StringWriter(CultureInfo.InvariantCulture);
3526outWriter = new StringWriter(CultureInfo.InvariantCulture);
3584var outWriter = new StringWriter(CultureInfo.InvariantCulture);
3612outWriter = new StringWriter(CultureInfo.InvariantCulture);
4349var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4370var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4493var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4753var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4758outWriter = new StringWriter(CultureInfo.InvariantCulture);
4776var outWriter = new StringWriter(CultureInfo.InvariantCulture);
4798var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5926var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5931outWriter = new StringWriter(CultureInfo.InvariantCulture);
5938outWriter = new StringWriter(CultureInfo.InvariantCulture);
5943outWriter = new StringWriter(CultureInfo.InvariantCulture);
5963var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5968outWriter = new StringWriter(CultureInfo.InvariantCulture);
5983var outWriter = new StringWriter(CultureInfo.InvariantCulture);
5988outWriter = new StringWriter(CultureInfo.InvariantCulture);
6360var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6450var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6549var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6591var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6632var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6968var outWriter = new StringWriter(CultureInfo.InvariantCulture);
6990var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7014var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7037var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7082var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7126var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7202var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7225var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7251var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7279var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7307var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7333var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7828int actualExitCode = csc.Run(new StringWriter(CultureInfo.InvariantCulture));
7872var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7879outWriter = new StringWriter(CultureInfo.InvariantCulture);
7886outWriter = new StringWriter(CultureInfo.InvariantCulture);
7893outWriter = new StringWriter(CultureInfo.InvariantCulture);
7919var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7927outWriter = new StringWriter(CultureInfo.InvariantCulture);
7953var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7961outWriter = new StringWriter(CultureInfo.InvariantCulture);
7987var outWriter = new StringWriter(CultureInfo.InvariantCulture);
7995outWriter = new StringWriter(CultureInfo.InvariantCulture);
8012var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8017outWriter = new StringWriter(CultureInfo.InvariantCulture);
8025outWriter = new StringWriter(CultureInfo.InvariantCulture);
8167var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8172outWriter = new StringWriter(CultureInfo.InvariantCulture);
8180outWriter = new StringWriter(CultureInfo.InvariantCulture);
8196var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8201outWriter = new StringWriter(CultureInfo.InvariantCulture);
8206outWriter = new StringWriter(CultureInfo.InvariantCulture);
8211outWriter = new StringWriter(CultureInfo.InvariantCulture);
8216outWriter = new StringWriter(CultureInfo.InvariantCulture);
8221outWriter = new StringWriter(CultureInfo.InvariantCulture);
8226outWriter = new StringWriter(CultureInfo.InvariantCulture);
8233outWriter = new StringWriter(CultureInfo.InvariantCulture);
8239outWriter = new StringWriter(CultureInfo.InvariantCulture);
8408var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8417outWriter = new StringWriter(CultureInfo.InvariantCulture);
8427outWriter = new StringWriter(CultureInfo.InvariantCulture);
8436outWriter = new StringWriter(CultureInfo.InvariantCulture);
8445outWriter = new StringWriter(CultureInfo.InvariantCulture);
8454outWriter = new StringWriter(CultureInfo.InvariantCulture);
8542var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8547outWriter = new StringWriter(CultureInfo.InvariantCulture);
8552outWriter = new StringWriter(CultureInfo.InvariantCulture);
8581var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8605var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8639var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8659var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8685var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8712var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8729var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8767var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8846var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8953var outWriter = new StringWriter(CultureInfo.InvariantCulture);
8972var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9009var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9032var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9054var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9084var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9105var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9131var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9158var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9223var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9250var writer = new StringWriter(CultureInfo.InvariantCulture);
9381var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9445var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9477var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9504var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9597var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9639var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9657var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9682var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9704var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9714Assert.Contains(AnalyzerThatThrowsInGetMessage.Rule.MessageFormat.ToString(CultureInfo.InvariantCulture), output, StringComparison.Ordinal);
9755var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9760outWriter = new StringWriter(CultureInfo.InvariantCulture);
9765outWriter = new StringWriter(CultureInfo.InvariantCulture);
9770outWriter = new StringWriter(CultureInfo.InvariantCulture);
9775outWriter = new StringWriter(CultureInfo.InvariantCulture);
9780outWriter = new StringWriter(CultureInfo.InvariantCulture);
9785outWriter = new StringWriter(CultureInfo.InvariantCulture);
9795var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9811var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9904var outWriter = new StringWriter(CultureInfo.InvariantCulture);
9910outWriter = new StringWriter(CultureInfo.InvariantCulture);
9916outWriter = new StringWriter(CultureInfo.InvariantCulture);
10105var outWriter = new StringWriter(CultureInfo.InvariantCulture);
10147var outWriter = new StringWriter(CultureInfo.InvariantCulture);
10655var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11273var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11285var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11297var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11309var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11690var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11870var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11935var outWriter = new StringWriter(CultureInfo.InvariantCulture);
11986var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12363var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12579var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12599var outWriter = new StringWriter(CultureInfo.InvariantCulture);
12646new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.None).GetMessage(CultureInfo.InvariantCulture),
12686new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_EmptySwitch), Location.None).GetMessage(CultureInfo.InvariantCulture),
12742new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_UnreferencedField, "C.f"), Location.None).GetMessage(CultureInfo.InvariantCulture),
12810new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_PrecedenceInversion, "from"), Location.None).GetMessage(CultureInfo.InvariantCulture),
12910new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_SequentialOnPartialClass, "MyPartialStruct"), Location.None).GetMessage(CultureInfo.InvariantCulture),
13020new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_SequentialOnPartialClass, "MyPartialStruct"), Location.None).GetMessage(CultureInfo.InvariantCulture),
13500var outWriter = new StringWriter(CultureInfo.InvariantCulture);
13745var outWriter = new StringWriter(CultureInfo.InvariantCulture);
13832var outWriter = new StringWriter(CultureInfo.InvariantCulture);
13869var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14838var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14900var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14920var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14945var outWriter = new StringWriter(CultureInfo.InvariantCulture);
14965var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15039var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15077var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15159var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15680var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15694outWriter = new StringWriter(CultureInfo.InvariantCulture);
15732var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15744outWriter = new StringWriter(CultureInfo.InvariantCulture);
15814var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15828outWriter = new StringWriter(CultureInfo.InvariantCulture);
15867var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15879outWriter = new StringWriter(CultureInfo.InvariantCulture);
15946var outWriter = new StringWriter(CultureInfo.InvariantCulture);
15985var outWriter = new StringWriter(CultureInfo.InvariantCulture);
16025var 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 (12)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (15)
src\Compilers\CSharp\Portable\SymbolDisplay\ObjectDisplay.cs (14)
357internal static string FormatLiteral(sbyte value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
371internal static string FormatLiteral(byte value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
383internal static string FormatLiteral(short value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
397internal static string FormatLiteral(ushort value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
409internal static string FormatLiteral(int value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
421internal static string FormatLiteral(uint value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
444internal static string FormatLiteral(long value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
467internal static string FormatLiteral(ulong value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
490internal static string FormatLiteral(double value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
497internal static string FormatLiteral(float value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
504internal static string FormatLiteral(decimal value, ObjectDisplayOptions options, CultureInfo? cultureInfo = null)
511private static CultureInfo GetFormatCulture(CultureInfo? cultureInfo)
513return cultureInfo ?? CultureInfo.InvariantCulture;
Microsoft.CodeAnalysis.CSharp.Features (10)
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 (30)
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 (4)
Microsoft.CodeAnalysis.EditorFeatures (15)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (6)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (4)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (6)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (8)
Microsoft.CodeAnalysis.Extensions.Package (4)
Microsoft.CodeAnalysis.ExternalAccess.Extensions (1)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Microsoft.CodeAnalysis.Features (37)
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)
100CultureInfo culture)
131public bool MatchesPattern(CompletionItem item, CultureInfo culture)
150? GetMatch(item.FilterText, includeMatchSpans, CultureInfo.CurrentCulture)
166var additionalMatch = GetMatch(additionalFilterText, includeMatchSpans, CultureInfo.CurrentCulture);
Microsoft.CodeAnalysis.InteractiveHost (16)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (21)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (10)
Microsoft.CodeAnalysis.PooledObjects.Package (3)
Microsoft.CodeAnalysis.PublicApiAnalyzers (10)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (5)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (6)
Microsoft.CodeAnalysis.Remote.Workspaces (2)
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
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 (71)
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 (85)
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.Workspaces (43)
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 (29)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.CommonLanguageServerProtocol.Framework.Package (3)
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.Feed (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 (1)
Microsoft.Extensions.AI.Evaluation (4)
Microsoft.Extensions.AI.Evaluation.Console (3)
Microsoft.Extensions.AI.Evaluation.NLP (1)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.Evaluation.Reporting (7)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (9)
Storage\AzureStorageResponseCache.cs (6)
97CultureInfo.CurrentCulture,
118CultureInfo.CurrentCulture,
250? string.Format(CultureInfo.CurrentCulture, EntryFileNotFound, entryFilePath)
251: string.Format(CultureInfo.CurrentCulture, ContentsFileNotFound, contentsFilePath));
273? string.Format(CultureInfo.CurrentCulture, EntryFileNotFound, entryFilePath)
274: string.Format(CultureInfo.CurrentCulture, ContentsFileNotFound, contentsFilePath));
Microsoft.Extensions.AI.Evaluation.Safety (1)
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 (5)
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)
77MajorNumber = int.Parse(parts[0], CultureInfo.InvariantCulture),
78MinorNumber = int.Parse(parts[1], CultureInfo.InvariantCulture),
80ReadsCompleted = ulong.Parse(parts[3], CultureInfo.InvariantCulture),
81ReadsMerged = ulong.Parse(parts[4], CultureInfo.InvariantCulture),
82SectorsRead = ulong.Parse(parts[5], CultureInfo.InvariantCulture),
83TimeReadingMs = uint.Parse(parts[6], CultureInfo.InvariantCulture),
84WritesCompleted = ulong.Parse(parts[7], CultureInfo.InvariantCulture),
85WritesMerged = ulong.Parse(parts[8], CultureInfo.InvariantCulture),
86SectorsWritten = ulong.Parse(parts[9], CultureInfo.InvariantCulture),
87TimeWritingMs = uint.Parse(parts[10], CultureInfo.InvariantCulture),
88IoInProgress = uint.Parse(parts[11], CultureInfo.InvariantCulture),
89TimeIoMs = uint.Parse(parts[12], CultureInfo.InvariantCulture),
90WeightedTimeIoMs = uint.Parse(parts[13], CultureInfo.InvariantCulture)
96diskStats.DiscardsCompleted = ulong.Parse(parts[14], CultureInfo.InvariantCulture);
97diskStats.DiscardsMerged = ulong.Parse(parts[15], CultureInfo.InvariantCulture);
98diskStats.SectorsDiscarded = ulong.Parse(parts[16], CultureInfo.InvariantCulture);
99diskStats.TimeDiscardingMs = uint.Parse(parts[17], CultureInfo.InvariantCulture);
104diskStats.FlushRequestsCompleted = ulong.Parse(parts[18], CultureInfo.InvariantCulture);
105diskStats.TimeFlushingMs = uint.Parse(parts[19], CultureInfo.InvariantCulture);
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 (5)
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 (11)
Latency\Internal\LatencyConsoleExporter.cs (5)
50CultureInfo.InvariantCulture,
71_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, c.Name, (double)c.Elapsed / c.Frequency * MillisPerSecond);
87_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, t.Name, t.Value);
103_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, m.Name, m.Value);
133_ = sb.AppendFormat(CultureInfo.InvariantCulture, fmt, nameHeader, valueHeader);
Microsoft.Extensions.Telemetry.Abstractions (3)
Microsoft.Extensions.Telemetry.PerformanceTests (2)
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 (5)
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.Tests (3)
Microsoft.VisualStudio.Extensibility.Testing.Xunit (3)
Microsoft.VisualStudio.LanguageServices (17)
Microsoft.VisualStudio.LanguageServices.CSharp (5)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.Implementation (27)
Options\AbstractOptionPageControl.cs (6)
294public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
297public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
303public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
310public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
316public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
332public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
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)
1847CultureInfo 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)
12005if (int.TryParse(traceSplits[splitRegions[1]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int flushDepth))
12013if (int.TryParse(traceSplits[splitRegions[2]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int luThreshold))
12250return args.IsEmpty ? string.Empty : string.Format(CultureInfo.InvariantCulture, s_format[args.Length], args);
12781return string.Create(CultureInfo.InvariantCulture, $"{OpDepth} {VDepth} {ItemIndex} {Op} {Detail}");
12943return string.Create(CultureInfo.InvariantCulture, $"{_itemIndex} ds: {_desiredSize} ar: {_arrangeRect} in: {_inset}");
13020return string.Create(CultureInfo.InvariantCulture, $"{g.IndexFromContainer(container, returnLocalIndex:true)}");
13029return string.Create(CultureInfo.InvariantCulture, $"{localIndex}");
13033return 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));
8566d = double.Parse(ptString, provider: CultureInfo.InvariantCulture);
8692imageStringBuilder.Append(width.ToString(CultureInfo.InvariantCulture));
8706imageStringBuilder.Append(height.ToString(CultureInfo.InvariantCulture));
8714imageStringBuilder.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)
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));
RepoTasks (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))
ResultsOfTGenerator (3)
Roslyn.Diagnostics.Analyzers (10)
Roslyn.Diagnostics.CSharp.Analyzers (7)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (2)
RoutingWebSite (1)
Sample (20)
artifacts\obj\Sample\Release\net11.0\generated\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs (17)
1131if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(id_temp!, CultureInfo.InvariantCulture, out var id_parsed_temp))
1148if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(size_temp!, CultureInfo.InvariantCulture, out var size_parsed_temp))
1178if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(id_temp!, CultureInfo.InvariantCulture, out var id_parsed_temp))
1195if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(size_temp!, CultureInfo.InvariantCulture, out var size_parsed_temp))
1537if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(element!, CultureInfo.InvariantCulture, out var parsed_element))
1567if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(element!, CultureInfo.InvariantCulture, out var parsed_element))
4577if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<global::System.Guid>(element!, CultureInfo.InvariantCulture, out var parsed_element))
4607if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<global::System.Guid>(element!, CultureInfo.InvariantCulture, out var parsed_element))
4826if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(id_temp!, CultureInfo.InvariantCulture, out var id_parsed_temp))
4856if (!GeneratedRouteBuilderExtensionsCore.TryParseExplicit<int>(id_temp!, CultureInfo.InvariantCulture, out var id_parsed_temp))
6081var message = string.Format(CultureInfo.InvariantCulture, "Failed to read parameter \"{0} {1}\" from the request body as JSON.", parameterTypeName, parameterName);
6098var message = string.Format(CultureInfo.InvariantCulture, "Failed to bind parameter \"{0} {1}\" from \"{2}\".", parameterTypeName, parameterName, sourceValue);
6115var message = string.Format(CultureInfo.InvariantCulture, "Required parameter \"{0} {1}\" was not provided from {2}.", parameterTypeName, parameterName, source);
6132var message = string.Format(CultureInfo.InvariantCulture, "Implicit body inferred for parameter \"{0}\" but no body was provided. Did you mean to use a Service instead?", parameterName);
6149var message = string.Format(CultureInfo.InvariantCulture, "Expected a supported JSON media type but got \"{0}\".", contentType);
6166var message = string.Format(CultureInfo.InvariantCulture, "Expected a supported form media type but got \"{0}\".", contentType);
6183var message = string.Format(CultureInfo.InvariantCulture, "Failed to read parameter \"{0} {1}\" from the request body as form.", parameterTypeName, parameterName);
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.GetDisplayText(), 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)
183return string.Format(CultureInfo.CurrentCulture, ErrorMessageString, name, Minimum, Maximum);
210Initialize((int)minimum, (int)maximum, v => Convert.ToInt32(v, CultureInfo.InvariantCulture));
215v => Convert.ToDouble(v, CultureInfo.InvariantCulture));
245: converter.ConvertFrom(null, CultureInfo.InvariantCulture, value);
System.ComponentModel.Composition (15)
System.ComponentModel.Composition.Registration (1)
System.ComponentModel.TypeConverter (144)
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?>?>();
205private SortedList<string, object?> FillResources(CultureInfo culture, out ResourceSet? resourceSet)
212if (!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)
273return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name);
317return IndexOutOfRange(SR.Format(SR.ADP_CollectionIndexInt32, index.ToString(CultureInfo.InvariantCulture), collection.Name, count.ToString(CultureInfo.InvariantCulture)));
457return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidSourceBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), srcOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
461return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidDestinationBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), dstOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
465return IndexOutOfRange(SR.Format(SR.SQL_InvalidBufferSizeOrIndex, numBytes.ToString(CultureInfo.InvariantCulture), bufferIndex.ToString(CultureInfo.InvariantCulture)));
469return IndexOutOfRange(SR.Format(SR.SQL_InvalidDataLength, length.ToString(CultureInfo.InvariantCulture)));
4730 == CultureInfo.InvariantCulture.CompareInfo.Compare(strvalue, strconst, CompareOptions.IgnoreCase);
475internal 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)
273return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name);
317return IndexOutOfRange(SR.Format(SR.ADP_CollectionIndexInt32, index.ToString(CultureInfo.InvariantCulture), collection.Name, count.ToString(CultureInfo.InvariantCulture)));
457return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidSourceBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), srcOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
461return ArgumentOutOfRange(SR.Format(SR.ADP_InvalidDestinationBufferIndex, maxLen.ToString(CultureInfo.InvariantCulture), dstOffset.ToString(CultureInfo.InvariantCulture)), parameterName);
465return IndexOutOfRange(SR.Format(SR.SQL_InvalidBufferSizeOrIndex, numBytes.ToString(CultureInfo.InvariantCulture), bufferIndex.ToString(CultureInfo.InvariantCulture)));
469return IndexOutOfRange(SR.Format(SR.SQL_InvalidDataLength, length.ToString(CultureInfo.InvariantCulture)));
4730 == CultureInfo.InvariantCulture.CompareInfo.Compare(strvalue, strconst, CompareOptions.IgnoreCase);
475internal 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)
779if (!int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out int s) || s < -11 || s > 20)
795if (!int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out int m) || m < 2)
837rateStats.Delta.HasValue ? rateStats.Delta.Value.ToString(CultureInfo.InvariantCulture) : "", rateStats.Value.ToString(CultureInfo.InvariantCulture), instrumentId);
842rateStats.Delta.HasValue ? rateStats.Delta.Value.ToString(CultureInfo.InvariantCulture) : "", rateStats.Value.ToString(CultureInfo.InvariantCulture), instrumentId);
848lastValueStats.LastValue.HasValue ? lastValueStats.LastValue.Value.ToString(CultureInfo.InvariantCulture) : "", instrumentId);
853synchronousLastValueStats.LastValue.ToString(CultureInfo.InvariantCulture), instrumentId);
903sb.Append(CultureInfo.InvariantCulture, $"{quantiles[i].Quantile}={quantiles[i].Value}");
System.Diagnostics.EventLog (2)
System.Diagnostics.Process (4)
System.Diagnostics.TextWriterTraceListener (8)
System.Diagnostics.TraceSource (4)
System.Drawing.Common (18)
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 (5)
System.Globalization (1)
System.IO.Packaging (2)
System.Linq.Expressions (9)
System.Net.Http (35)
System\Net\Http\Headers\HeaderUtilities.cs (6)
149throw new FormatException(SR.Format(CultureInfo.InvariantCulture, SR.net_http_headers_invalid_value, value));
160throw new FormatException(SR.Format(CultureInfo.InvariantCulture, SR.net_http_headers_invalid_value, value));
171throw new FormatException(SR.Format(CultureInfo.InvariantCulture, SR.net_http_headers_invalid_value, value));
303int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out result);
313return int.TryParse(value.AsSpan(offset, length), NumberStyles.None, CultureInfo.InvariantCulture, out result);
324return long.TryParse(value.AsSpan(offset, length), NumberStyles.None, CultureInfo.InvariantCulture, out result);
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.NetworkInformation (7)
System.Net.Ping (1)
System.Net.Primitives (16)
System\Net\IPEndPoint.cs (6)
137isConvertedToInt = uint.TryParse(MemoryMarshal.Cast<TChar, byte>(portSpan), NumberStyles.None, CultureInfo.InvariantCulture, out port);
141isConvertedToInt = uint.TryParse(MemoryMarshal.Cast<TChar, char>(portSpan), NumberStyles.None, CultureInfo.InvariantCulture, out port);
297destination.TryWrite(CultureInfo.InvariantCulture, $"[{_address}]:{_port}", out charsWritten) :
298destination.TryWrite(CultureInfo.InvariantCulture, $"{_address}:{_port}", out charsWritten);
306Utf8.TryWrite(utf8Destination, CultureInfo.InvariantCulture, $"[{_address}]:{_port}", out bytesWritten) :
307Utf8.TryWrite(utf8Destination, CultureInfo.InvariantCulture, $"{_address}:{_port}", out bytesWritten);
System\Net\IPNetwork.cs (5)
188int.TryParse(prefixLengthSpan, NumberStyles.None, CultureInfo.InvariantCulture, out int prefixLength) &&
216int.TryParse(prefixLengthSpan, NumberStyles.None, CultureInfo.InvariantCulture, out int prefixLength) &&
284string.Create(CultureInfo.InvariantCulture, stackalloc char[128], $"{BaseAddress}/{(uint)PrefixLength}");
293destination.TryWrite(CultureInfo.InvariantCulture, $"{BaseAddress}/{(uint)PrefixLength}", out charsWritten);
302Utf8.TryWrite(utf8Destination, CultureInfo.InvariantCulture, $"{BaseAddress}/{(uint)PrefixLength}", out bytesWritten);
System.Net.Requests (2)
System.Net.Security (2)
System.Net.ServerSentEvents (2)
System.Net.WebSockets.Client (3)
System.Private.CoreLib (433)
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)
304public ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
334public object? CreateInstanceAndUnwrap(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
361public ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder? binder, object?[]? args, Globalization.CultureInfo? culture, object?[]? activationAttributes)
387public 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\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;
331internal static bool VerifyCultureName(CultureInfo culture, bool throwException)
358public static CultureInfo CurrentCulture
373Interlocked.CompareExchange(ref s_asyncLocalCurrentCulture, new AsyncLocal<CultureInfo>(AsyncLocalSetCurrentCulture), null);
379public static CultureInfo CurrentUICulture
395Interlocked.CompareExchange(ref s_asyncLocalCurrentUICulture, new AsyncLocal<CultureInfo>(AsyncLocalSetCurrentUICulture), null);
403internal static CultureInfo UserDefaultUICulture => s_userDefaultUICulture ?? InitializeUserDefaultUICulture();
405public static CultureInfo InstalledUICulture => s_userDefaultCulture ?? InitializeUserDefaultCulture();
407public static CultureInfo? DefaultThreadCurrentCulture
416public static CultureInfo? DefaultThreadCurrentUICulture
444public static CultureInfo InvariantCulture
456public virtual CultureInfo Parent
462CultureInfo culture;
514Interlocked.CompareExchange<CultureInfo?>(ref _parent, culture, null);
524public static CultureInfo[] GetCultures(CultureTypes types)
638if (value is CultureInfo that)
861public CultureInfo GetConsoleFallbackUICulture()
863CultureInfo? temp = _consoleFallbackCulture;
875CultureInfo ci = (CultureInfo)MemberwiseClone();
918public static CultureInfo ReadOnly(CultureInfo ci)
926CultureInfo newInfo = (CultureInfo)(ci.MemberwiseClone());
988public static CultureInfo GetCultureInfo(int culture)
992Dictionary<int, CultureInfo> lcidTable = CachedCulturesByLcid;
993CultureInfo? result;
1024public static CultureInfo GetCultureInfo(string name)
1029Dictionary<string, CultureInfo> nameTable = CachedCulturesByName;
1030CultureInfo? result;
1061public static CultureInfo GetCultureInfo(string name, string altName)
1069Dictionary<string, CultureInfo> nameTable = CachedCulturesByName;
1070CultureInfo? result;
1100public static CultureInfo GetCultureInfo(string name, bool predefinedOnly)
1115private static Dictionary<string, CultureInfo> CachedCulturesByName
1119Dictionary<string, CultureInfo>? cache = s_cachedCulturesByName;
1122cache = new Dictionary<string, CultureInfo>();
1130private static Dictionary<int, CultureInfo> CachedCulturesByLcid
1134Dictionary<int, CultureInfo>? cache = s_cachedCulturesByLcid;
1137cache = new Dictionary<int, CultureInfo>();
1145public static CultureInfo GetCultureInfoByIetfLanguageTag(string name)
1153CultureInfo 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)
148return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, GetCaseCompareOfComparisonCulture(comparisonType));
169public static int Compare(string? strA, string? strB, CultureInfo? culture, CompareOptions options)
171CultureInfo compareCulture = culture ?? CultureInfo.CurrentCulture;
181public static int Compare(string? strA, string? strB, bool ignoreCase, CultureInfo? culture)
232return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, indexA, lengthA, strB, indexB, lengthB, options);
240public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, bool ignoreCase, CultureInfo? culture)
250public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, CultureInfo? culture, CompareOptions options)
252CultureInfo compareCulture = culture ?? CultureInfo.CurrentCulture;
310return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, indexA, lengthA, strB, indexB, lengthB, GetCaseCompareOfComparisonCulture(comparisonType));
451return CultureInfo.CurrentCulture.CompareInfo.IsSuffix(this, value, GetCaseCompareOfComparisonCulture(comparisonType));
472public bool EndsWith(string value, bool ignoreCase, CultureInfo? culture)
481CultureInfo referenceCulture = culture ?? CultureInfo.CurrentCulture;
597return CultureInfo.CurrentCulture.CompareInfo.Compare(this, value, GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
655return CultureInfo.CurrentCulture.CompareInfo.Compare(a, b, GetCaseCompareOfComparisonCulture(comparisonType)) == 0;
720return CultureInfo.CurrentCulture.CompareInfo.GetHashCode(value, GetCaseCompareOfComparisonCulture(comparisonType));
1058return CultureInfo.CurrentCulture.CompareInfo.IsPrefix(this, value, GetCaseCompareOfComparisonCulture(comparisonType));
1088public bool StartsWith(string value, bool ignoreCase, CultureInfo? culture)
1097CultureInfo referenceCulture = culture ?? CultureInfo.CurrentCulture;
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (10)
987var result = new DefaultInterpolatedStringHandler(0, 0, CultureInfo.CurrentCulture, stackalloc char[StackallocCharBufferSizeLimit]);
1187public string Replace(string oldValue, string? newValue, bool ignoreCase, CultureInfo? culture)
1195StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => ReplaceCore(oldValue, newValue, CultureInfo.CurrentCulture.CompareInfo, GetCaseCompareOfComparisonCulture(comparisonType)),
1212return ReplaceCore(this, oldValue.AsSpan(), newValue.AsSpan(), ci ?? CultureInfo.CurrentCulture.CompareInfo, options)
2355public string ToLower(CultureInfo? culture)
2357CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
2370public string ToUpper(CultureInfo? culture)
2372CultureInfo cult = culture ?? CultureInfo.CurrentCulture;
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (4)
117StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.IndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
331StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.IndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
530StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.LastIndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
660StringComparison.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 (32)
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 (5)
System.Private.Windows.Core.TestUtilities (37)
System.Private.Windows.GdiPlus (1)
System.Private.Xml (190)
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)
1017if (!int.TryParse(lengthStringSpan, CultureInfo.InvariantCulture, out soapArrayInfo.length))
1077soapArrayInfo.length = int.Parse(dimensions[i], CultureInfo.InvariantCulture);
1574throw new InvalidOperationException(SR.Format(SR.XmlInvalidArrayRef, id, o.GetType().FullName, i.ToString(CultureInfo.InvariantCulture)));
2139_arrayName = string.Create(CultureInfo.InvariantCulture, $"{arrayName}_{i}");
2513Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture));
2661Writer.Write(i.ToString(CultureInfo.InvariantCulture));
2693Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture));
2842string.Create(CultureInfo.InvariantCulture, $"Read{++NextMethodNumber}_{CodeIdentifier.MakeValidInternal(name)}");
2845string.Create(CultureInfo.InvariantCulture, $"id{(++_nextIdNumber)}_{CodeIdentifier.MakeValidInternal(name)}");
2912uniqueName = name + i.ToString(CultureInfo.InvariantCulture);
2972Writer.Write(string.Create(CultureInfo.InvariantCulture, $"{constants[i].Value}L"));
3537string fixupIndex = member.FixupIndex.ToString(CultureInfo.InvariantCulture);
3591string createName = string.Create(CultureInfo.InvariantCulture, $"create{++_nextCreateMethodNumber}_{typeDesc.Name}");
3915Writer.Write(fixupCount.ToString(CultureInfo.InvariantCulture));
4027StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
4256Writer.Write(cases.ToString(CultureInfo.InvariantCulture));
4332Writer.Write(member.FixupIndex.ToString(CultureInfo.InvariantCulture));
4365Writer.Write(cases.ToString(CultureInfo.InvariantCulture));
4556Writer.Write((fixupIndex).ToString(CultureInfo.InvariantCulture));
4783Writer.Write((fixupIndex).ToString(CultureInfo.InvariantCulture));
5007Writer.Write(length.ToString(CultureInfo.InvariantCulture));
System\Xml\Serialization\XmlSerializationWriter.cs (25)
634long index = long.Parse(name.AsSpan(prefixLength), NumberStyles.Integer, CultureInfo.InvariantCulture);
948id = string.Create(CultureInfo.InvariantCulture, $"{_idBase}id{++_nextId}");
1316_w.WriteAttributeString("arraySize", Soap12.Encoding, arrayLength.ToString(CultureInfo.InvariantCulture));
1339_w.WriteAttributeString("arraySize", Soap12.Encoding, arrayLength.ToString(CultureInfo.InvariantCulture));
1732_writer.Write(string.Format(CultureInfo.InvariantCulture, HelperClassesForUseReflection,
2164_writer.Write(c.Value.ToString(CultureInfo.InvariantCulture));
2685Writer.Write(xmlnsMember.ToString(CultureInfo.InvariantCulture));
2699string index = i.ToString(CultureInfo.InvariantCulture);
2726Writer.Write(specifiedPosition.ToString(CultureInfo.InvariantCulture));
2772string index = i.ToString(CultureInfo.InvariantCulture);
2781Writer.Write(specifiedPosition.ToString(CultureInfo.InvariantCulture));
2842Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture));
2846WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength");
2905return string.Create(CultureInfo.InvariantCulture, $"Write{++NextMethodNumber}_{CodeIdentifier.MakeValidInternal(name)}");
2978Writer.Write(c.Value.ToString(CultureInfo.InvariantCulture));
4392Writer.Write(((DateTime)value).Ticks.ToString(CultureInfo.InvariantCulture));
4400Writer.Write(((DateTimeOffset)value).Ticks.ToString(CultureInfo.InvariantCulture));
4404Writer.Write(((DateTimeOffset)value).Offset.Ticks.ToString(CultureInfo.InvariantCulture));
4412Writer.Write(((TimeSpan)value).Ticks.ToString(CultureInfo.InvariantCulture));
4420Writer.Write(((DateOnly)value).Year.ToString(CultureInfo.InvariantCulture));
4422Writer.Write(((DateOnly)value).Month.ToString(CultureInfo.InvariantCulture));
4424Writer.Write(((DateOnly)value).Day.ToString(CultureInfo.InvariantCulture));
4432Writer.Write(((TimeOnly)value).Ticks.ToString(CultureInfo.InvariantCulture));
4525enumValue = choiceMapping.Constants[i].Value.ToString(CultureInfo.InvariantCulture);
4541enumValue = 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 (8)
System.Security.Cryptography.Xml (35)
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.Http (7)
System.ServiceModel.NetFramingBase (3)
System.ServiceModel.NetNamedPipe (2)
System.ServiceModel.NetTcp (2)
System.ServiceModel.Primitives (170)
Internals\System\Xml\XmlMtomReader.cs (7)
111throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(string.Format(CultureInfo.InvariantCulture, "encodings[{0}]", i));
325return string.Format(CultureInfo.InvariantCulture, "<{0}>", startUri);
410contentID = string.Format(CultureInfo.InvariantCulture, "<{0}>", Uri.UnescapeDataString(uri.Substring(MimeGlobals.ContentIDScheme.Length)));
2718throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SRP.Format(SRP.MimeHeaderInvalidCharacter, (char)(*ptr), ((int)(*ptr)).ToString("X", CultureInfo.InvariantCulture))));
3092throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SRP.Format(SRP.MimeHeaderInvalidCharacter, data[offset], ((int)data[offset]).ToString("X", CultureInfo.InvariantCulture))));
3126throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SRP.Format(SRP.MimeHeaderInvalidCharacter, data[offset], ((int)data[offset]).ToString("X", CultureInfo.InvariantCulture))));
3158throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SRP.Format(SRP.MimeHeaderInvalidCharacter, data[offset], ((int)data[offset]).ToString("X", CultureInfo.InvariantCulture))));
Internals\System\Xml\XmlMtomWriter.cs (12)
167string.Format(CultureInfo.InvariantCulture, "{0}/{1};{2}=\"{3}\";{4}=\"{5}\"",
173contentTypeBuilder.AppendFormat(CultureInfo.InvariantCulture, ";{0}=\"<{1}>\"", MtomGlobals.StartParam, startUri);
176contentTypeBuilder.AppendFormat(CultureInfo.InvariantCulture, ";{0}=\"{1}\"", MtomGlobals.StartInfoParam, startInfo);
183string contentType = string.Format(CultureInfo.InvariantCulture, "{0};{1}={2}", MtomGlobals.XopType, MtomGlobals.CharsetParam, CharSet(encoding));
186contentType = string.Format(CultureInfo.InvariantCulture, "{0};{1}=\"{2}\"", contentType, MtomGlobals.TypeParam, startInfo);
438Writer.WriteValue(string.Format(CultureInfo.InvariantCulture, "{0}{1}", MimeGlobals.ContentIDScheme, _contentID));
481Writer.WriteString(string.Format(CultureInfo.InvariantCulture, "{0}{1}", MimeGlobals.ContentIDScheme, _contentID));
493return string.Format(CultureInfo.InvariantCulture, "http://tempuri.org/{0}/{1}", index, DateTime.Now.Ticks);
578_mimeWriter.WriteHeader(MimeGlobals.ContentIDHeader, string.Format(CultureInfo.InvariantCulture, "<{0}>", contentID));
589_mimeWriter.WriteHeader(MimeGlobals.ContentIDHeader, string.Format(CultureInfo.InvariantCulture, "<{0}>", contentID));
1056return string.Format(CultureInfo.InvariantCulture, "{0}{1}", prefix, nextId);
1466throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SRP.Format(SRP.MimeHeaderInvalidCharacter, c, ((int)c).ToString("X", CultureInfo.InvariantCulture))));
System\ServiceModel\Channels\SecurityBindingElement.cs (11)
606sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0}:", GetType().ToString()));
607sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "DefaultAlgorithmSuite: {0}", _defaultAlgorithmSuite.ToString()));
608sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "IncludeTimestamp: {0}", IncludeTimestamp.ToString()));
609sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "KeyEntropyMode: {0}", _keyEntropyMode.ToString()));
610sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "MessageSecurityVersion: {0}", MessageSecurityVersion.ToString()));
611sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "SecurityHeaderLayout: {0}", _securityHeaderLayout.ToString()));
612sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "ProtectTokens: {0}", _protectTokens.ToString()));
620sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "OperationSupportingTokenParameters: none"));
626sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "OperationSupportingTokenParameters[\"{0}\"]:", requestAction));
633sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "OptionalOperationSupportingTokenParameters: none"));
639sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "OptionalOperationSupportingTokenParameters[\"{0}\"]:", requestAction));
System\ServiceModel\Security\SecurityTimestamp.cs (9)
140CultureInfo.InvariantCulture,
159throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampHasCreationAheadOfExpiry, CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture))));
171throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampHasExpiryTimeInPast, ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew)));
177throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampHasCreationTimeInFuture, CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew)));
183throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampWasCreatedTooLongAgo, CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), timeToLive, allowedClockSkew)));
System\ServiceModel\Security\Tokens\IssuedSecurityTokenParameters.cs (15)
153sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "TokenType: {0}", TokenType == null ? "null" : TokenType));
154sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "KeyType: {0}", _keyType.ToString()));
155sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "KeySize: {0}", _keySize.ToString(CultureInfo.InvariantCulture)));
156sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "IssuerAddress: {0}", IssuerAddress == null ? "null" : IssuerAddress.ToString()));
157sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "IssuerMetadataAddress: {0}", IssuerMetadataAddress == null ? "null" : IssuerMetadataAddress.ToString()));
158sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "DefaultMessgeSecurityVersion: {0}", DefaultMessageSecurityVersion == null ? "null" : DefaultMessageSecurityVersion.ToString()));
159sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "UseStrTransform: {0}", UseStrTransform.ToString()));
163sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "IssuerBinding: null"));
167sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "IssuerBinding:"));
171sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " BindingElement[{0}]:", i.ToString(CultureInfo.InvariantCulture)));
178sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "ClaimTypeRequirements: none"));
182sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "ClaimTypeRequirements:"));
185sb.AppendLine(string.Format(CultureInfo.InvariantCulture, " {0}, optional={1}", ClaimTypeRequirements[i].ClaimType, ClaimTypeRequirements[i].IsOptional));
System.ServiceModel.Primitives.Tests (1)
System.ServiceModel.Syndication (11)
System.ServiceModel.UnixDomainSocket (1)
System.Speech (12)
System.Text.Json (10)
System.Text.Json.SourceGeneration (14)
System.Text.RegularExpressions (40)
System\Text\RegularExpressions\Regex.cs (6)
69internal Regex(string pattern, CultureInfo? culture)
87internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture)
119private RegexTree Init(string pattern, RegexOptions options, TimeSpan matchTimeout, [NotNull] ref CultureInfo? culture)
252RegexTree tree = RegexParser.Parse(pattern, options, (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture);
392return 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);
252internal 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)
499found = string.Compare(str, GetItemText(items[index]), ignoreCase, CultureInfo.CurrentCulture) == 0;
503found = string.Compare(str, 0, GetItemText(items[index]), 0, str.Length, ignoreCase, CultureInfo.CurrentCulture) == 0;
530return Convert.ToString(item, CultureInfo.CurrentCulture);
569return Convert.ToString(item, CultureInfo.CurrentCulture);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (5)
1133private static string FormatDate(DateTime value) => value.ToString("d", CultureInfo.CurrentCulture);
1757throw new ArgumentOutOfRangeException(nameof(x), string.Format(SR.MonthCalendarInvalidDimensions, (x).ToString("D", CultureInfo.CurrentCulture), (y).ToString("D", CultureInfo.CurrentCulture)));
1762throw 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.CSharp (3)
System.Windows.Forms.Analyzers.CSharp.Tests (9)
System.Windows.Forms.Design (142)
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)));
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.GetDisplayText(), 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.GetDisplayText(), 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.GetDisplayText(), 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.GetDisplayText(), 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.GetDisplayText(), 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 (5)
TestPassApp (2)
TestProject.AppHost (1)
TestStartupAssembly1 (2)
Text.Analyzers (10)
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)
Wasm.Performance.ConsoleHost (12)
Wasm.Performance.TestApp (6)
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)
WithDockerfile.AppHost (1)
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)
Xunit.NetCore.Extensions (10)