87 references to ApartmentState
mscorlib (19)
system\applicationactivator.cs (8)
32
private
ApartmentState
m_apt;
59
m_apt =
ApartmentState
.Unknown;
95
if (checkAptModel && m_apt !=
ApartmentState
.Unknown) {
96
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.Unknown && Thread.CurrentThread.GetApartmentState() != m_apt)
107
m_apt =
ApartmentState
.STA;
110
if (m_apt ==
ApartmentState
.Unknown)
111
m_apt =
ApartmentState
.MTA;
113
m_apt =
ApartmentState
.Unknown;
system\threading\thread.cs (11)
952
public
ApartmentState
ApartmentState
957
return (
ApartmentState
)GetApartmentStateNative();
969
public
ApartmentState
GetApartmentState()
971
return (
ApartmentState
)GetApartmentStateNative();
976
public bool TrySetApartmentState(
ApartmentState
state)
983
public void SetApartmentState(
ApartmentState
state)
991
private bool SetApartmentStateHelper(
ApartmentState
state, bool fireMDAOnMismatch)
993
ApartmentState
retState = (
ApartmentState
)SetApartmentStateNative((int)state, fireMDAOnMismatch);
999
if ((state == System.Threading.
ApartmentState
.Unknown) && (retState == System.Threading.
ApartmentState
.MTA))
PresentationCore (14)
Core\CSharp\System\Windows\Input\InputManager.cs (1)
181
if(Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
Core\CSharp\System\Windows\Input\InputProcessorProfiles.cs (1)
78
Debug.Assert(Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA, "Initialize called on MTA thread!");
Core\CSharp\System\Windows\Input\InputProcessorProfilesLoader.cs (1)
74
Debug.Assert(Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA, "Load called on MTA thread!");
Core\CSharp\System\Windows\Input\TextServicesContext.cs (1)
63
Debug.Assert(Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA, "SetDispatcherThreaad on MTA thread");
Core\CSharp\System\Windows\Media\Effects\BitmapEffect.cs (1)
65
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
Core\CSharp\System\Windows\OleServicesContext.cs (9)
122
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
141
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
160
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
181
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
200
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
234
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
251
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
277
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
307
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA)
PresentationFramework (8)
src\Framework\MS\Internal\AppModel\XappLauncher.cs (1)
535
thread.SetApartmentState(
ApartmentState
.STA);
src\Framework\System\Windows\Documents\TextServicesHost.cs (1)
81
Debug.Assert(Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA, "OnRegisterTextStore must be called on STA thread");
src\Framework\System\Windows\Interop\ActiveXHost.cs (1)
113
if (Thread.CurrentThread.ApartmentState !=
ApartmentState
.STA)
src\Framework\System\Windows\Interop\BrowserInteropHelper.cs (1)
93
Verify.IsApartmentState(
ApartmentState
.STA);
src\Framework\System\Windows\Interop\DocobjHost.cs (1)
85
Debug.Assert(_mainThread.ApartmentState ==
ApartmentState
.STA);
src\Framework\System\Windows\Shell\JumpList.cs (1)
562
Verify.IsApartmentState(
ApartmentState
.STA);
src\Framework\System\Windows\Standard\Debug.cs (1)
338
public static void IsApartmentState(
ApartmentState
expectedState)
src\Framework\System\Windows\Standard\Verify.cs (1)
39
public static void IsApartmentState(
ApartmentState
requiredState, string message)
System (4)
compmod\microsoft\win32\SystemEvents.cs (1)
572
if (!UserInteractive || Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA) {
services\monitoring\system\diagnosticts\Process.cs (2)
2855
if( Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.STA) {
2858
executionThread.SetApartmentState(
ApartmentState
.STA);
sys\system\collections\concurrent\BlockingCollection.cs (1)
1765
return Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA;
System.Data (2)
fx\src\data\System\Data\OleDb\OleDbConnectionInternal.cs (2)
687
if (
ApartmentState
.Unknown == Thread.CurrentThread.GetApartmentState()) {
697
Thread.CurrentThread.SetApartmentState(
ApartmentState
.MTA);
System.Management (15)
Instrumentation\EventSource.cs (1)
343
thread.SetApartmentState(
ApartmentState
.MTA);
Instrumentation\Instrumentation.cs (1)
497
cleanupThread.SetApartmentState(
ApartmentState
.MTA);
InteropClasses\WMIInterop.cs (13)
1986
thread.SetApartmentState(
ApartmentState
.MTA);
2100
if(Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.MTA)
2191
private
ApartmentState
apartmentType ; // Apartment type of thread
2252
public
ApartmentState
ApartmentType
2298
InitializeThreadState ( null, workerMethod,
ApartmentState
.MTA, false ) ;
2311
InitializeThreadState ( null, workerMethod,
ApartmentState
.MTA, false ) ;
2324
InitializeThreadState ( null, workerMethod,
ApartmentState
.MTA, false ) ;
2337
InitializeThreadState ( null, workerMethod,
ApartmentState
.MTA, false ) ;
2371
this.apartmentType =
ApartmentState
.MTA ;
2380
private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithReturn workerMethod,
ApartmentState
aptState, bool background )
2395
private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithReturnAndParam workerMethod,
ApartmentState
aptState, bool background )
2410
private void InitializeThreadState ( object threadParams, ThreadWorkerMethod workerMethod,
ApartmentState
aptState, bool background )
2425
private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithParam workerMethod,
ApartmentState
aptState, bool background )
System.ServiceModel (2)
System\ServiceModel\Administration\WbemProvider.cs (2)
1059
if (Thread.CurrentThread.GetApartmentState() !=
ApartmentState
.MTA)
1064
thread.SetApartmentState(
ApartmentState
.MTA);
System.Windows.Forms (18)
winforms\Managed\System\WinForms\Application.cs (4)
1336
public static System.Threading.
ApartmentState
OleRequired() {
3178
internal System.Threading.
ApartmentState
OleRequired() {
3207
return System.Threading.
ApartmentState
.MTA;
3210
return System.Threading.
ApartmentState
.STA;
winforms\Managed\System\WinForms\AxHost.cs (2)
285
if (Application.OleRequired() !=
ApartmentState
.STA) {
3641
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
winforms\Managed\System\WinForms\Clipboard.cs (2)
111
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
218
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
winforms\Managed\System\WinForms\ComboBox.cs (2)
201
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
249
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
winforms\Managed\System\WinForms\Control.cs (1)
11238
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
winforms\Managed\System\WinForms\FileDialog.cs (1)
982
if (Control.CheckForIllegalCrossThreadCalls && Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
winforms\Managed\System\WinForms\FolderBrowserDialog.cs (1)
257
if (Control.CheckForIllegalCrossThreadCalls && Application.OleRequired() != System.Threading.
ApartmentState
.STA)
winforms\Managed\System\WinForms\Printing\PrintControllerWithStatusDialog.cs (1)
170
thread.SetApartmentState(
ApartmentState
.STA);
winforms\Managed\System\WinForms\ToolStripDropTargetManager.cs (1)
252
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA)
winforms\Managed\System\WinForms\TrustManager.cs (1)
1078
thread.SetApartmentState(System.Threading.
ApartmentState
.STA);
winforms\Managed\System\WinForms\WebBrowserBase.cs (2)
108
if (Application.OleRequired() !=
ApartmentState
.STA) {
1361
if (Application.OleRequired() != System.Threading.
ApartmentState
.STA) {
System.Workflow.Runtime (2)
DebugEngine\ProgramPublisher.cs (2)
50
publisherThread.SetApartmentState(
ApartmentState
.MTA);
93
unpublisherThread.SetApartmentState(
ApartmentState
.MTA);
WindowsBase (3)
Base\MS\Internal\Verify.cs (1)
33
public static void IsApartmentState(
ApartmentState
requiredState)
Base\System\Windows\Threading\Dispatcher.cs (1)
2429
if (Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA)
Shared\MS\Internal\TextServicesLoader.cs (1)
111
Invariant.Assert(Thread.CurrentThread.GetApartmentState() ==
ApartmentState
.STA, "Load called on MTA thread!");