487 references to CurrentThread
Aspire.Dashboard.Components.Tests (7)
UseCultureAttribute.cs (7)
11/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and 68_originalCulture = Thread.CurrentThread.CurrentCulture; 69_originalUICulture = Thread.CurrentThread.CurrentUICulture; 71Thread.CurrentThread.CurrentCulture = Culture; 72Thread.CurrentThread.CurrentUICulture = UICulture; 86Thread.CurrentThread.CurrentCulture = _originalCulture!; 87Thread.CurrentThread.CurrentUICulture = _originalUICulture!;
Aspire.Hosting.Tests (12)
Utils\UseCultureAttributeTests.cs (12)
71var originalCulture = Thread.CurrentThread.CurrentCulture; 76Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture); 80Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture); 89var originalUICulture = Thread.CurrentThread.CurrentUICulture; 94Assert.Equal(attr.UICulture, Thread.CurrentThread.CurrentUICulture); 98Assert.Equal(originalUICulture, Thread.CurrentThread.CurrentUICulture); 104Assert.Equal("sv-SE", Thread.CurrentThread.CurrentCulture.Name); 110Assert.Equal("es-CL", Thread.CurrentThread.CurrentUICulture.Name); 119var originalCulture = Thread.CurrentThread.CurrentCulture; 124var ri = new RegionInfo(Thread.CurrentThread.CurrentCulture.LCID); 126Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture); 131Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
Aspire.Microsoft.Data.SqlClient (3)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\ExceptionExtensions.cs (3)
20var originalUICulture = Thread.CurrentThread.CurrentUICulture; 24Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 29Thread.CurrentThread.CurrentUICulture = originalUICulture;
Aspire.Microsoft.EntityFrameworkCore.SqlServer (3)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\ExceptionExtensions.cs (3)
20var originalUICulture = Thread.CurrentThread.CurrentUICulture; 24Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 29Thread.CurrentThread.CurrentUICulture = originalUICulture;
Aspire.TestUtilities (8)
UseCultureAttribute.cs (7)
14/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and 64_originalCulture = Thread.CurrentThread.CurrentCulture; 65_originalUICulture = Thread.CurrentThread.CurrentUICulture; 70Thread.CurrentThread.CurrentCulture = Culture; 71Thread.CurrentThread.CurrentUICulture = UICulture; 88Thread.CurrentThread.CurrentCulture = _originalCulture; 93Thread.CurrentThread.CurrentUICulture = _originalUICulture;
UseDefaultXunitCultureAttribute.cs (1)
9/// Apply this attribute to your test method to replace the <see cref="Thread.CurrentThread" />
Binding.Http.IntegrationTests (2)
OperationContextTests.cs (2)
48int currentThreadId = Thread.CurrentThread.ManagedThreadId; 50Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId);
Binding.Tcp.IntegrationTests (8)
OperationContextAsyncFlowTests.cs (8)
35int currentThreadId = Thread.CurrentThread.ManagedThreadId; 37Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId); 70int currentThreadId = Thread.CurrentThread.ManagedThreadId; 72Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId); 78currentThreadId = Thread.CurrentThread.ManagedThreadId; 80Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId); 161int currentThreadId = Thread.CurrentThread.ManagedThreadId; 163Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId);
dotnet-svcutil.xmlserializer (3)
Microsoft\Tools\ServiceModel\SvcUtil\Tool.cs (3)
96Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); 100(System.Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage)) 102Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Metrics (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Metrics.Legacy (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
181if (Thread.CurrentThread.CurrentCulture.Parent.Name == "en")
Microsoft.AspNetCore.Components.Tests (25)
Rendering\RendererSynchronizationContextTest.cs (25)
21var thread = Thread.CurrentThread; 29capturedThread = Thread.CurrentThread; 69var thread = Thread.CurrentThread; 90capturedThread = Thread.CurrentThread; 231capturedThread = Thread.CurrentThread; 247Assert.Same(Thread.CurrentThread, capturedThread); 252Assert.Same(Thread.CurrentThread, capturedThread); 298var thread = Thread.CurrentThread; 304capturedThread = Thread.CurrentThread; 407var thread = Thread.CurrentThread; 413capturedThread = Thread.CurrentThread; 426var thread = Thread.CurrentThread; 446capturedThread = Thread.CurrentThread; 499var thread = Thread.CurrentThread; 504return Thread.CurrentThread; 516var thread = Thread.CurrentThread; 537return Thread.CurrentThread; 587var thread = Thread.CurrentThread; 593capturedThread = Thread.CurrentThread; 607var thread = Thread.CurrentThread; 627capturedThread = Thread.CurrentThread; 681var thread = Thread.CurrentThread; 686return Task.FromResult(Thread.CurrentThread); 698var thread = Thread.CurrentThread; 719return Task.FromResult(Thread.CurrentThread);
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostBuilder.cs (1)
205var currentThread = Thread.CurrentThread;
Microsoft.AspNetCore.DataProtection.Tests (1)
KeyManagement\KeyRingProviderTests.cs (1)
688Thread foregroundThread = Thread.CurrentThread;
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
FormatWeekHelper.cs (1)
21var calendar = Thread.CurrentThread.CurrentCulture.Calendar;
Microsoft.AspNetCore.OutputCaching.Tests (3)
OutputCacheKeyProviderTests.cs (3)
115var culture = Thread.CurrentThread.CurrentCulture; 118Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-FR"); 124Thread.CurrentThread.CurrentCulture = culture;
Microsoft.Build (17)
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1450file.WriteLine("{0}({1})-{2}: {3}", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, DateTime.UtcNow.Ticks, message);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (4)
723Thread.CurrentThread.Priority = _componentHost.BuildParameters.BuildThreadPriority; 724Thread.CurrentThread.IsBackground = true; 736if (string.IsNullOrEmpty(Thread.CurrentThread.Name)) 738Thread.CurrentThread.Name = threadName;
BackEnd\Components\Scheduler\Scheduler.cs (1)
2605file.Write("{0}({1})-{2}: ", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, _schedulingData.EventTime.Ticks);
BackEnd\Node\OutOfProcServerNode.cs (2)
376Thread.CurrentThread.CurrentCulture = command.Culture; 377Thread.CurrentThread.CurrentUICulture = command.UICulture;
CommunicationsUtilities.cs (2)
982file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
Instance\RunningObjectTable.cs (2)
31if (Thread.CurrentThread.GetApartmentState() == ApartmentState.MTA) 60if (Thread.CurrentThread.GetApartmentState() == ApartmentState.MTA)
NodeEndpointOutOfProcBase.cs (1)
312ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
ThreadPoolExtensions.cs (4)
32Thread.CurrentThread.CurrentCulture = culture; 37Thread.CurrentThread.CurrentUICulture = uiCulture; 47Thread.CurrentThread.CurrentCulture = originalThreadCulture; 52Thread.CurrentThread.CurrentUICulture = originalThreadUICulture;
Microsoft.Build.CommandLine.UnitTests (4)
XMake_Tests.cs (4)
890Thread thisThread = Thread.CurrentThread; 922Thread thisThread = Thread.CurrentThread; 957Thread thisThread = Thread.CurrentThread; 1170Assert.Equal(new CultureInfo("en"), Thread.CurrentThread.CurrentUICulture);
Microsoft.Build.Engine.UnitTests (46)
BackEnd\NodeEndpointInProc_Tests.cs (6)
115_dataReceivedContext = new DataReceivedContext(Thread.CurrentThread, packet); 309Assert.Equal(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 315Assert.Equal(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 342Assert.NotEqual(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 352Assert.NotEqual(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 445_linkStatusTable[endpoint] = new LinkStatusContext(Thread.CurrentThread, status);
BackEnd\TaskHostConfiguration_Tests.cs (30)
45culture: Thread.CurrentThread.CurrentCulture, 46uiCulture: Thread.CurrentThread.CurrentUICulture, 81culture: Thread.CurrentThread.CurrentCulture, 82uiCulture: Thread.CurrentThread.CurrentUICulture, 117culture: Thread.CurrentThread.CurrentCulture, 118uiCulture: Thread.CurrentThread.CurrentUICulture, 191culture: Thread.CurrentThread.CurrentCulture, 192uiCulture: Thread.CurrentThread.CurrentUICulture, 218culture: Thread.CurrentThread.CurrentCulture, 219uiCulture: Thread.CurrentThread.CurrentUICulture, 246culture: Thread.CurrentThread.CurrentCulture, 247uiCulture: Thread.CurrentThread.CurrentUICulture, 279culture: Thread.CurrentThread.CurrentCulture, 280uiCulture: Thread.CurrentThread.CurrentUICulture, 312culture: Thread.CurrentThread.CurrentCulture, 313uiCulture: Thread.CurrentThread.CurrentUICulture, 352culture: Thread.CurrentThread.CurrentCulture, 353uiCulture: Thread.CurrentThread.CurrentUICulture, 451culture: Thread.CurrentThread.CurrentCulture, 452uiCulture: Thread.CurrentThread.CurrentUICulture, 503culture: Thread.CurrentThread.CurrentCulture, 504uiCulture: Thread.CurrentThread.CurrentUICulture, 553culture: Thread.CurrentThread.CurrentCulture, 554uiCulture: Thread.CurrentThread.CurrentUICulture, 602culture: Thread.CurrentThread.CurrentCulture, 603uiCulture: Thread.CurrentThread.CurrentUICulture, 658culture: Thread.CurrentThread.CurrentCulture, 659uiCulture: Thread.CurrentThread.CurrentUICulture, 709culture: Thread.CurrentThread.CurrentCulture, 710uiCulture: Thread.CurrentThread.CurrentUICulture,
Evaluation\Expander_Tests.cs (3)
4996var currentThread = Thread.CurrentThread; 5039var currentThread = Thread.CurrentThread; 5082var currentThread = Thread.CurrentThread;
Evaluation\ExpanderFunction_Tests.cs (1)
255Thread currentThread = Thread.CurrentThread;
FileUtilities_Tests.cs (3)
302var currentCulture = Thread.CurrentThread.CurrentCulture; 305Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); // Turkish 313Thread.CurrentThread.CurrentCulture = currentCulture;
TerminalLogger_Tests.cs (3)
51private readonly CultureInfo _originalCulture = Thread.CurrentThread.CurrentCulture; 65Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 143Thread.CurrentThread.CurrentCulture = _originalCulture;
Microsoft.Build.Framework (1)
BuildEventArgs.cs (1)
91threadId = System.Threading.Thread.CurrentThread.GetHashCode();
Microsoft.Build.Tasks.Core (3)
BootstrapperUtil\Util.cs (1)
77public static CultureInfo DefaultCultureInfo => System.Threading.Thread.CurrentThread.CurrentUICulture;
CommunicationsUtilities.cs (2)
982file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
Microsoft.Build.Utilities.UnitTests (3)
CommandLineBuilder_Tests.cs (3)
62var currentCulture = Thread.CurrentThread.CurrentCulture; 65Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); // Turkish 73Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
1853var originalCulture = Thread.CurrentThread.CurrentCulture; 1854Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR", useUserOverride: false); 1857Thread.CurrentThread.CurrentCulture = originalCulture; 2891var currentUICultureName = Thread.CurrentThread.CurrentUICulture.Name;
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (3)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (2)
90if (Thread.CurrentThread.CurrentCulture.Name == SupportedLanguage) 205if (Thread.CurrentThread.CurrentCulture.Name == SupportedLanguage)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
133if (Thread.CurrentThread.CurrentCulture.Name == "en-US")
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\SemanticErrorTests.cs (6)
1695var savedCurrentCulture = Thread.CurrentThread.CurrentCulture; 1696var savedCurrentUICulture = Thread.CurrentThread.CurrentUICulture; 1697Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 1698Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 1712Thread.CurrentThread.CurrentCulture = savedCurrentCulture; 1713Thread.CurrentThread.CurrentUICulture = savedCurrentUICulture;
Microsoft.CodeAnalysis.EditorFeatures (2)
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs (2)
79_thread = Thread.CurrentThread; 83=> Contract.ThrowIfFalse(Thread.CurrentThread == _thread);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Threading\WpfTestRunner.cs (1)
59Debug.Assert(sta.StaThread == Thread.CurrentThread);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Utilities\PatternMatcherTests.cs (3)
405var previousCulture = Thread.CurrentThread.CurrentCulture; 407Thread.CurrentThread.CurrentCulture = turkish; 418Thread.CurrentThread.CurrentCulture = previousCulture;
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.Test.Utilities (1)
Assert\UseCultureAttribute.cs (1)
17/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and
Microsoft.CodeAnalysis.UnitTests (3)
CommonCommandLineParserTests.cs (3)
53CultureInfo saveUICulture = Thread.CurrentThread.CurrentUICulture; 64Thread.CurrentThread.CurrentUICulture = preferred; 81Thread.CurrentThread.CurrentUICulture = saveUICulture;
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
2886Dim currentUICultureName = Thread.CurrentThread.CurrentUICulture.Name
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (9)
CodeGen\AnonymousTypesCodeGenTests.vb (6)
368Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 369System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture 421System.Threading.Thread.CurrentThread.CurrentCulture = currCulture 768Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 769System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture 808System.Threading.Thread.CurrentThread.CurrentCulture = currCulture
Semantics\StaticLocalsSemanticTests.vb (3)
347Dim currCulture = Thread.CurrentThread.CurrentCulture 348Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture 392Thread.CurrentThread.CurrentCulture = currCulture
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (14)
Semantics\BinaryOperators.vb (9)
23Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 24System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) 53System.Threading.Thread.CurrentThread.CurrentCulture = currCulture 62Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 63System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) 229System.Threading.Thread.CurrentThread.CurrentCulture = currCulture 384Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 385System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) 497System.Threading.Thread.CurrentThread.CurrentCulture = currCulture
Semantics\Conversions.vb (3)
3283Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 3284System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US") 3454System.Threading.Thread.CurrentThread.CurrentCulture = currCulture
Semantics\InterpolatedStringTests.vb (2)
560Dim previousCulture = Thread.CurrentThread.CurrentCulture 589Assert.Equal(previousCulture, Thread.CurrentThread.CurrentCulture)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (22)
DocumentationComments\DocCommentTests.vb (6)
12133saveUICulture = Thread.CurrentThread.CurrentUICulture 12134Thread.CurrentThread.CurrentUICulture = preferred 12142Thread.CurrentThread.CurrentUICulture = saveUICulture 12174saveUICulture = Thread.CurrentThread.CurrentUICulture 12175Thread.CurrentThread.CurrentUICulture = preferred 12183Thread.CurrentThread.CurrentUICulture = saveUICulture
SymbolDisplay\ObjectDisplayTests.vb (6)
226Dim originalCulture = CurrentThread.CurrentCulture 228CurrentThread.CurrentCulture = New CultureInfo(1031) ' de-DE 238Assert.Equal("12,5", ObjectDisplay.FormatLiteral(decimalValue, ObjectDisplayOptions.None, CurrentThread.CurrentCulture)) 244Assert.Equal("12,5", ObjectDisplay.FormatLiteral(doubleValue, ObjectDisplayOptions.None, CurrentThread.CurrentCulture)) 250Assert.Equal("12,5", ObjectDisplay.FormatLiteral(singleValue, ObjectDisplayOptions.None, CurrentThread.CurrentCulture)) 253CurrentThread.CurrentCulture = originalCulture
SymbolDisplay\SymbolDisplayTests.vb (10)
3194Dim oldCulture = Thread.CurrentThread.CurrentCulture 3196Thread.CurrentThread.CurrentCulture = CType(oldCulture.Clone(), CultureInfo) 3197Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign = "~" 3198Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = "," 3213Thread.CurrentThread.CurrentCulture = oldCulture 3236Dim oldCulture = Thread.CurrentThread.CurrentCulture 3238Thread.CurrentThread.CurrentCulture = CType(oldCulture.Clone(), CultureInfo) 3239Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign = "~" 3240Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = "," 3255Thread.CurrentThread.CurrentCulture = oldCulture
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (3)
Scanner\ScannerTests.vb (3)
1806Dim SavedCultureInfo = CurrentThread.CurrentCulture 1808CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("de-DE", False) 1838CurrentThread.CurrentCulture = SavedCultureInfo
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
TestExportJoinableTaskContext.cs (1)
56mainThread = Thread.CurrentThread;
TestExportJoinableTaskContext+DenyExecutionSynchronizationContext.cs (1)
75/// used for checking if <see cref="Thread.CurrentThread"/> matches a known "main thread", and ensures that
Microsoft.CodeAnalysis.Workspaces.UnitTests (12)
CodeCleanup\FixIncorrectTokenTests.cs (3)
715var savedCulture = System.Threading.Thread.CurrentThread.CurrentCulture; 719System.Threading.Thread.CurrentThread.CurrentCulture = 729System.Threading.Thread.CurrentThread.CurrentCulture = savedCulture;
CodeCleanup\ReduceTokenTests.cs (7)
1723var savedCulture = System.Threading.Thread.CurrentThread.CurrentCulture; 1727System.Threading.Thread.CurrentThread.CurrentCulture = 1751System.Threading.Thread.CurrentThread.CurrentCulture = savedCulture; 1758var oldCulture = Thread.CurrentThread.CurrentCulture; 1761Thread.CurrentThread.CurrentCulture = (CultureInfo)oldCulture.Clone(); 1762Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign = "~"; 1785Thread.CurrentThread.CurrentCulture = oldCulture;
UtilityTest\AsyncLazyTests.cs (2)
71synchronousRequestThread = Thread.CurrentThread; 93asyncContinuationRanSynchronously = currentSynchronousRequestThread != null && currentSynchronousRequestThread == Thread.CurrentThread;
Microsoft.Data.Analysis.Tests (1)
test\Microsoft.ML.TestFramework\BaseTestClass.cs (1)
47Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.Extensions.Diagnostics.Testing.Tests (3)
Logging\FakeLoggerTests.cs (3)
121var oldCulture = Thread.CurrentThread.CurrentCulture; 122Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-CA"); 142Thread.CurrentThread.CurrentCulture = oldCulture;
Microsoft.Extensions.Telemetry.Tests (1)
Enrichment\ProcessLogEnricherTests.cs (1)
63Assert.Equal(Thread.CurrentThread.ManagedThreadId.ToString(CultureInfo.InvariantCulture), enrichedState[ProcessEnricherTagNames.ThreadId]);
Microsoft.Gen.Logging.Generated.Tests (3)
LogMethodTests.cs (3)
861var oldCulture = Thread.CurrentThread.CurrentCulture; 862Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-CA"); 868Thread.CurrentThread.CurrentCulture = oldCulture;
Microsoft.Maui.Graphics (1)
PdfExportContext.cs (1)
22 if ("en-US".Equals(Thread.CurrentThread.CurrentCulture.Name, StringComparison.Ordinal))
Microsoft.Maui.Resizetizer (5)
AsyncTask.cs (5)
59 uiThreadId = Thread.CurrentThread.ManagedThreadId; 108 if (uiThreadId == Thread.CurrentThread.ManagedThreadId) 137 if (uiThreadId == Thread.CurrentThread.ManagedThreadId) 182 if (uiThreadId == Thread.CurrentThread.ManagedThreadId) 216 if (uiThreadId == Thread.CurrentThread.ManagedThreadId)
Microsoft.ML.AutoML.Tests (6)
TunerTests.cs (6)
393var originalCuture = Thread.CurrentThread.CurrentCulture; 395Thread.CurrentThread.CurrentCulture = usCulture; 397Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator.Should().Be("."); 409Thread.CurrentThread.CurrentCulture = frCulture; 410Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator.Should().Be(","); 421Thread.CurrentThread.CurrentCulture = originalCuture;
Microsoft.ML.CodeGenerator.Tests (3)
TrainerGeneratorTests.cs (3)
39var currentCulture = Thread.CurrentThread.CurrentCulture; 40Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); 45Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.ML.IntegrationTests (1)
IntegrationTestBaseClass.cs (1)
39Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.ML.PerformanceTests (1)
Program.cs (1)
20Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Microsoft.ML.SearchSpace.Tests (3)
ParameterTest.cs (3)
126var originalCuture = Thread.CurrentThread.CurrentCulture; 128Thread.CurrentThread.CurrentCulture = culture; 133Thread.CurrentThread.CurrentCulture = originalCuture;
Microsoft.ML.TestFramework (1)
BaseTestClass.cs (1)
47Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.ML.Tests (6)
TrainerEstimators\TreeEstimators.cs (3)
779var currentCulture = Thread.CurrentThread.CurrentCulture; 780Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE"); 788Thread.CurrentThread.CurrentCulture = currentCulture;
Transformers\LineParserTests.cs (3)
54var currentCulture = Thread.CurrentThread.CurrentCulture; 55Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE"); 73Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.VisualBasic.Core (9)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
136nfi = Threading.Thread.CurrentThread.CurrentCulture.NumberFormat
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
69Return System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat 77Return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ANSICodePage
Microsoft\VisualBasic\CompilerServices\VB6File.vb (1)
2112NegativeSign = Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign
Microsoft\VisualBasic\DateAndTime.vb (1)
134Return Threading.Thread.CurrentThread.CurrentCulture.Calendar
Microsoft\VisualBasic\Strings.vb (4)
519Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToLower(Value) 528Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToLower(Value) 1043Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToUpper(Value) 1052Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToUpper(Value)
Microsoft.VisualBasic.Forms (6)
Microsoft\VisualBasic\ApplicationServices\ApplicationBase.vb (4)
30Return Thread.CurrentThread.CurrentCulture 74Return Thread.CurrentThread.CurrentUICulture 86Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) 98Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName)
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (1)
111Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args)
Microsoft\VisualBasic\Interaction.vb (1)
221If Thread.CurrentThread.GetApartmentState() <> ApartmentState.STA Then
Microsoft.VisualBasic.Tests (6)
Microsoft\VisualBasic\ApplicationServices\ApplicationBaseTests.cs (6)
13Assert.Equal(Thread.CurrentThread.CurrentCulture, culture); 17Assert.Equal(Thread.CurrentThread.CurrentCulture, app.Culture); 22Thread.CurrentThread.CurrentCulture = culture; 31Assert.Equal(Thread.CurrentThread.CurrentUICulture, culture); 35Assert.Equal(Thread.CurrentThread.CurrentUICulture, app.UICulture); 40Thread.CurrentThread.CurrentUICulture = culture;
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CodeModel\MethodXML\MethodXMLTests_VBAssignments.vb (2)
869Dim currentThread = Thread.CurrentThread 934Dim currentThread = Thread.CurrentThread
MSBuild (10)
CommunicationsUtilities.cs (2)
982file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
NodeEndpointOutOfProcBase.cs (1)
312ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
OutOfProcTaskHostNode.cs (2)
928Thread.CurrentThread.CurrentCulture = taskConfiguration.Culture; 929Thread.CurrentThread.CurrentUICulture = taskConfiguration.UICulture;
ThreadPoolExtensions.cs (4)
32Thread.CurrentThread.CurrentCulture = culture; 37Thread.CurrentThread.CurrentUICulture = uiCulture; 47Thread.CurrentThread.CurrentCulture = originalThreadCulture; 52Thread.CurrentThread.CurrentUICulture = originalThreadUICulture;
XMake.cs (1)
1922Thread thisThread = Thread.CurrentThread;
MSBuildTaskHost (7)
CommunicationsUtilities.cs (2)
982file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
NodeEndpointOutOfProcBase.cs (1)
312ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
OutOfProcTaskAppDomainWrapperBase.cs (2)
235staThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; 236staThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
OutOfProcTaskHostNode.cs (2)
928Thread.CurrentThread.CurrentCulture = taskConfiguration.Culture; 929Thread.CurrentThread.CurrentUICulture = taskConfiguration.UICulture;
PresentationCore (16)
System\Windows\Input\InputManager.cs (1)
142if(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
System\Windows\Input\InputMethod.cs (1)
416Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread);
System\Windows\Input\InputProcessorProfiles.cs (1)
35Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
56Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
307Thread.CurrentThread.Name = "DynamicRenderer";
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (1)
1143Thread.CurrentThread.Name = "Stylus Input";
System\Windows\Input\TextServicesContext.cs (1)
46Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\Media\Effects\BitmapEffect.cs (1)
26if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
System\Windows\Media\HostVisual.cs (3)
135Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 188Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 321Dispatcher channelDispatcher = Dispatcher.FromThread(Thread.CurrentThread);
System\Windows\OleServicesContext.cs (5)
89if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 112if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 125if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 141if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 172if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
PresentationFramework (24)
Microsoft\Win32\CommonDialog.cs (2)
230if (_thread != Thread.CurrentThread) 318private readonly Thread _thread = Thread.CurrentThread;
MS\Internal\Data\ClrBindingWorker.cs (2)
388if (Dispatcher.Thread == Thread.CurrentThread) 413if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (2)
30this._dispatcherThread = Thread.CurrentThread; 339return Thread.CurrentThread == this._dispatcherThread;
System\Windows\Controls\SelectedDatesCollection.cs (2)
33this._dispatcherThread = Thread.CurrentThread; 469return Thread.CurrentThread == this._dispatcherThread;
System\Windows\Controls\SpellCheck.cs (1)
141new FrameworkPropertyMetadata(Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "de" ? SpellingReform.Postreform : SpellingReform.PreAndPostreform,
System\Windows\Controls\WebBrowser.cs (2)
291HRESULT hr = scriptObjectEx.GetIDsOfNames(ref guid, names, 1, Thread.CurrentThread.CurrentCulture.LCID, dispids); 319Thread.CurrentThread.CurrentCulture.LCID,
System\Windows\Data\BindingExpression.cs (1)
2495if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Data\BindingExpressionBase.cs (1)
432if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Data\BindingGroup.cs (1)
1499if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Documents\Speller.cs (1)
50Thread.CurrentThread.CurrentCulture;
System\Windows\Documents\TextServicesHost.cs (3)
61Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 66_thread = Thread.CurrentThread; 372if (_thread == Thread.CurrentThread || System.Environment.OSVersion.Version.Major >= 6)
System\Windows\Documents\TextStore.cs (1)
2408Invariant.Assert(Thread.CurrentThread == _textservicesHost.Dispatcher.Thread, "GrantLock called on bad thread!");
System\Windows\Documents\WinRTSpellerInterop.cs (1)
54_defaultCulture = InputLanguageManager.Current?.CurrentInputLanguage ?? Thread.CurrentThread.CurrentCulture;
System\Windows\Interop\ActiveXHost.cs (1)
83if (Thread.CurrentThread.GetApartmentState() is not ApartmentState.STA)
System\Windows\Standard\Debug.cs (1)
338if (Thread.CurrentThread.GetApartmentState() != expectedState)
System\Windows\Standard\Verify.cs (1)
40if (Thread.CurrentThread.GetApartmentState() != requiredState)
System\Windows\SystemResources.cs (1)
1302Dispatcher dispatcher = isSysColorsOrSettingsChange ? null : Dispatcher.FromThread(System.Threading.Thread.CurrentThread);
ReachFramework (7)
PrintConfig\PTProvider.cs (2)
183this._thread = Thread.CurrentThread; 559if(_thread != Thread.CurrentThread)
PrintConfig\PTUtility.cs (1)
40return _resManager.GetString(key, System.Threading.Thread.CurrentThread.CurrentUICulture);
PrintSystemExceptions\PrintSystemException.cs (4)
221System.Threading.Thread.CurrentThread.CurrentUICulture); 240System.Threading.Thread.CurrentThread.CurrentUICulture); 244exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, 250exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture,
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
System.Collections.Concurrent (1)
System\Collections\Concurrent\BlockingCollection.cs (1)
1663((collections.Length == 63) && (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)))
System.Private.CoreLib (46)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (1)
28Thread currentThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (18)
54ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 79return Thread.CurrentThread._executionContext; 100Thread currentThread = Thread.CurrentThread; 115Thread currentThread = Thread.CurrentThread; 127ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 154Thread currentThread = Thread.CurrentThread; 227Thread currentThread = Thread.CurrentThread; 250Debug.Assert(threadPoolThread == Thread.CurrentThread); 301Thread.CurrentThread._executionContext = executionContext; 314Debug.Assert(currentThread == Thread.CurrentThread); 350Debug.Assert(!Thread.IsThreadStartSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 351Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 352Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 450ExecutionContext? current = Thread.CurrentThread._executionContext; 464ExecutionContext? current = Thread.CurrentThread._executionContext; 528Thread.CurrentThread._executionContext = 556Debug.Assert(currentThread == Thread.CurrentThread); 567if (Thread.CurrentThread != _thread)
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (4)
61bool isLocked = _ownerThread == Thread.CurrentThread; 72Debug.Assert(_ownerThread == Thread.CurrentThread); 82Debug.Assert(_ownerThread != Thread.CurrentThread); 109_ownerThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.cs (2)
28public bool IsLocked => _ownerThread == Thread.CurrentThread; 71_ownerThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (2)
34if (!BlockingConfig.IsCooperativeBlockingEnabled || !Thread.CurrentThread.IsThreadPoolThread) 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
src\libraries\System.Private.CoreLib\src\System\Threading\SynchronizationContext.cs (2)
16public static SynchronizationContext? Current => Thread.CurrentThread._synchronizationContext; 55public static void SetSynchronizationContext(SynchronizationContext? syncContext) => Thread.CurrentThread._synchronizationContext = syncContext;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
593if (isDefaultScheduler && taskWasPreviouslyQueued && !Thread.CurrentThread.IsThreadPoolThread)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (1)
489(TaskScheduler.InternalCurrent == m_scheduler || Thread.CurrentThread.IsThreadPoolThread);
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (6)
276if (this != CurrentThread) 316if (this != CurrentThread) 334if (this != CurrentThread) 425Debug.Assert(ThreadState.HasFlag(ThreadState.Unstarted) || this == CurrentThread); 438Debug.Assert(this == CurrentThread); 450Debug.Assert(this == CurrentThread);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolCallbackWrapper.cs (1)
12Thread currentThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (2)
1227Debug.Assert(currentThread == Thread.CurrentThread); 1288currentThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (1)
729ExecutionContext.RunFromThreadPoolDispatchLoop(Thread.CurrentThread, context, s_callCallbackInContext, this);
src\System\GC.CoreCLR.cs (1)
314Thread currentThread = Thread.CurrentThread;
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (1)
27_thread = Thread.CurrentThread;
src\System\Runtime\ControlledExecution.CoreCLR.cs (1)
55Canceler canceler = new(Thread.CurrentThread);
src\System\Threading\Thread.CoreCLR.cs (2)
462Debug.Assert(this == CurrentThread); 473Debug.Assert(this == CurrentThread);
System.Private.Windows.Core.TestUtilities (8)
XUnit\UseCultureAttribute.cs (7)
15/// Apply this attribute to your test method to replace the <see cref="Thread.CurrentThread" /> 74_originalCulture = Thread.CurrentThread.CurrentCulture; 75_originalUICulture = Thread.CurrentThread.CurrentUICulture; 78Thread.CurrentThread.CurrentCulture = Culture; 79Thread.CurrentThread.CurrentUICulture = UICulture; 98Thread.CurrentThread.CurrentCulture = _originalCulture; 99Thread.CurrentThread.CurrentUICulture = _originalUICulture;
XUnit\UseDefaultXunitCultureAttribute.cs (1)
9/// Apply this attribute to your test method to replace the <see cref="Thread.CurrentThread" />
System.Transactions.Local (5)
System\Transactions\TransactionScope.cs (5)
521if ((_scopeThread != Thread.CurrentThread) && !AsyncFlowEnabled) 907_scopeThread = Thread.CurrentThread; 973if (_scopeThread == Thread.CurrentThread) 990if (_savedCurrentScope._scopeThread != Thread.CurrentThread) 1011if (_scopeThread != Thread.CurrentThread)
System.Windows.Forms (9)
System\Windows\Forms\Application.ComponentThreadContext.cs (1)
404_idleHandler?.Invoke(Thread.CurrentThread, EventArgs.Empty);
System\Windows\Forms\Application.cs (3)
226get => Thread.CurrentThread.CurrentCulture; 227set => Thread.CurrentThread.CurrentCulture = value; 1247=> ThreadContext.FromCurrent()._idleHandler?.Invoke(Thread.CurrentThread, e);
System\Windows\Forms\Application.LightThreadContext.cs (1)
121_idleHandler?.Invoke(Thread.CurrentThread, EventArgs.Empty);
System\Windows\Forms\Application.ThreadContext.cs (3)
238_enterModalHandler(Thread.CurrentThread, EventArgs.Empty); 425_leaveModalHandler(Thread.CurrentThread, EventArgs.Empty); 594_threadExceptionHandler(Thread.CurrentThread, new ThreadExceptionEventArgs(ex));
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (1)
29DestinationThread = Thread.CurrentThread;
System.Windows.Forms.Analyzers.CSharp.Tests (2)
FontConverterTests.cs (1)
66Thread.CurrentThread.CurrentCulture = culture;
Generators\ApplicationConfigurationGenerator\ApplicationConfigurationInitializeBuilderTests.cs (1)
153Thread.CurrentThread.CurrentCulture = culture;
System.Windows.Forms.Analyzers.Tests (1)
Analyzers\AppManifestAnalyzer\FontDescriptorTests.cs (1)
67Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName);
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\MaskDescriptor.cs (1)
41public virtual CultureInfo Culture => Thread.CurrentThread.CurrentCulture;
System.Windows.Forms.Design.Tests (7)
System\Windows\Forms\Design\MaskDescriptorTests.cs (7)
14_originalCulture = Thread.CurrentThread.CurrentCulture; 19Thread.CurrentThread.CurrentCulture = _originalCulture; 62Thread.CurrentThread.CurrentCulture = newCulture; 131Thread.CurrentThread.CurrentCulture = new(culture1); 136Thread.CurrentThread.CurrentCulture = _originalCulture; 140Thread.CurrentThread.CurrentCulture = new(culture2); 156Thread.CurrentThread.CurrentCulture = _originalCulture;
System.Windows.Forms.IntegrationTests.Common (2)
TestHelpers.cs (2)
400Thread.CurrentThread.CurrentCulture = cultureInfo; 401Thread.CurrentThread.CurrentUICulture = cultureInfo;
System.Windows.Forms.Tests (22)
System\Windows\Forms\ApplicationTests.cs (3)
20Assert.Same(Thread.CurrentThread.CurrentCulture, Application.CurrentCulture); 52Assert.Same(value, Thread.CurrentThread.CurrentCulture); 59Assert.Same(value, Thread.CurrentThread.CurrentCulture);
System\Windows\Forms\KeysConverterTests.cs (10)
63CultureInfo originalUICulture = Thread.CurrentThread.CurrentUICulture; 66Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(cultureName); 69object resultWithUICulture = converter.ConvertTo(context: null, culture: Thread.CurrentThread.CurrentUICulture, keys, typeof(Enum[])); 76Thread.CurrentThread.CurrentUICulture = originalUICulture; 96CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; 97CultureInfo originalUICulture = Thread.CurrentThread.CurrentUICulture; 100Thread.CurrentThread.CurrentCulture = cultureName is not null ? CultureInfo.GetCultureInfo(cultureName) : originalCulture; 101Thread.CurrentThread.CurrentUICulture = uiCultureName is not null ? CultureInfo.GetCultureInfo(uiCultureName) : originalUICulture; 125Thread.CurrentThread.CurrentCulture = originalCulture; 126Thread.CurrentThread.CurrentUICulture = originalUICulture;
System\Windows\Forms\KeysConverterTests.LocalizationTests.cs (3)
24CultureInfo originalUICulture = Thread.CurrentThread.CurrentUICulture; 40Thread.CurrentThread.CurrentUICulture = targetCulture; 49Thread.CurrentThread.CurrentUICulture = originalUICulture;
System\Windows\Forms\ToolStripMenuItemTests.cs (6)
150CultureInfo uiCulture = Thread.CurrentThread.CurrentUICulture; 151CultureInfo curCulture = Thread.CurrentThread.CurrentCulture; 153Thread.CurrentThread.CurrentUICulture = threadUICulture; 154Thread.CurrentThread.CurrentCulture = threadCulture; 159Thread.CurrentThread.CurrentUICulture = uiCulture; 160Thread.CurrentThread.CurrentCulture = curCulture;
System.Windows.Forms.UI.IntegrationTests (1)
Infra\ControlTestBase.cs (1)
62if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)
Test.Utilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
WindowsBase.Tests (3)
System\Windows\Threading\DispatcherTests.cs (3)
21Assert.Same(Thread.CurrentThread, dispatcher.Thread); 33Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread); 40Assert.Same(Thread.CurrentThread, dispatcher.Thread);
WinFormsControlsTest (4)
Program.cs (4)
8Thread.CurrentThread.SetApartmentState(ApartmentState.Unknown); 9Thread.CurrentThread.SetApartmentState(ApartmentState.STA); 17Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;