2 types derived from ThreadContext
System.Windows.Forms (2)
System\Windows\Forms\Application.ComponentThreadContext.cs (1)
18
ThreadContext
,
System\Windows\Forms\Application.LightThreadContext.cs (1)
13
internal sealed unsafe class LightThreadContext :
ThreadContext
84 references to ThreadContext
System.Windows.Forms (84)
System\Windows\Forms\Application.ComponentManager.cs (1)
243
ThreadContext
.FromCurrent().DisposeThreadWindows();
System\Windows\Forms\Application.ComponentThreadContext.cs (1)
15
/// <see cref="
ThreadContext
"/> that supports <see cref="IMsoComponent"/>.
System\Windows\Forms\Application.cs (45)
84
public static bool AllowQuit =>
ThreadContext
.GetAllowQuit();
242
=>
ThreadContext
.FromCurrent().CustomThreadExceptionHandlerAttached;
547
=>
ThreadContext
.FromCurrent().GetMessageLoop();
659
=>
ThreadContext
.FromCurrent().RegisterMessageLoop(callback);
787
=>
ThreadContext
.FromCurrent().RegisterMessageLoop(null);
960
=>
ThreadContext
.FromCurrent().AddMessageFilter(value);
970
bool processed =
ThreadContext
.FromCurrent().ProcessFilters(ref msg, out bool modified);
990
ThreadContext
current =
ThreadContext
.FromCurrent();
999
ThreadContext
current =
ThreadContext
.FromCurrent();
1015
ThreadContext
current =
ThreadContext
.FromCurrent();
1023
ThreadContext
current =
ThreadContext
.FromCurrent();
1039
ThreadContext
current =
ThreadContext
.FromCurrent();
1047
ThreadContext
current =
ThreadContext
.FromCurrent();
1062
ThreadContext
current =
ThreadContext
.FromCurrent();
1070
ThreadContext
current =
ThreadContext
.FromCurrent();
1094
=>
ThreadContext
.FromCurrent().BeginModalMessageLoop(null);
1100
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.DoEvents, null);
1103
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.DoEventsModal, null);
1144
=>
ThreadContext
.FromCurrent().EndModalMessageLoop(null);
1226
ThreadContext
.ExitApplication();
1241
ThreadContext
context =
ThreadContext
.FromCurrent();
1261
ThreadContext
.FromCurrent().FormActivated(activated);
1321
internal static unsafe
ThreadContext
GetContextForHandle<T>(T handle) where T : IHandle<HWND>
1323
ThreadContext
? threadContext =
ThreadContext
.FromId(PInvokeCore.GetWindowThreadProcessId(handle.Handle, null));
1403
ThreadContext
threadContext =
ThreadContext
.FromCurrent();
1414
=>
ThreadContext
.FromCurrent().OleRequired();
1420
=>
ThreadContext
.FromCurrent().OnThreadException(t);
1428
ThreadContext
threadContext = GetContextForHandle(handle);
1437
=>
ThreadContext
.FromCurrent()._idleHandler?.Invoke(Thread.CurrentThread, e);
1443
=>
ThreadContext
.FromCurrent().RemoveMessageFilter(value);
1492
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.Main, new ApplicationContext());
1499
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.Main, new ApplicationContext(mainForm));
1506
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.Main, context);
1514
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.ModalForm, new ModalApplicationContext(form));
System\Windows\Forms\Application.LightThreadContext.cs (1)
11
/// Lighter weight <see cref="
ThreadContext
"/> that doesn't support <see cref="IMsoComponent"/>.
System\Windows\Forms\Application.ModalApplicationContext.cs (4)
12
private
ThreadContext
? _parentWindowContext;
14
private delegate void ThreadWindowCallback(
ThreadContext
context, bool onlyWinForms);
51
private void DisableThreadWindowsCallback(
ThreadContext
context, bool onlyWinForms)
54
private void EnableThreadWindowsCallback(
ThreadContext
context, bool onlyWinForms)
System\Windows\Forms\Application.ParkingWindow.cs (3)
74
ThreadContext
? context =
ThreadContext
.FromId(id);
77
if (context is null || !ReferenceEquals(context,
ThreadContext
.FromCurrent()))
System\Windows\Forms\Application.ThreadContext.cs (8)
26
private static readonly ConcurrentDictionary<uint,
ThreadContext
> s_contextHash = [];
33
private static
ThreadContext
? t_currentThreadContext;
436
foreach ((_,
var
threadContext) in s_contextHash)
479
internal static
ThreadContext
FromCurrent() => t_currentThreadContext ?? Create();
481
private static
ThreadContext
Create()
483
ThreadContext
context = LocalAppContextSwitches.EnableMsoComponentManager
493
internal static
ThreadContext
? FromId(uint id)
495
if (s_contextHash.TryGetValue(id, out
ThreadContext
? context))
System\Windows\Forms\Application.ThreadWindows.cs (1)
62
Control? activatingControl =
ThreadContext
.FromCurrent().ActivatingControl;
System\Windows\Forms\Control.cs (4)
1187
Application.
ThreadContext
.FromCurrent().ActivatingControl = value ? this : null;
3734
Application.
ThreadContext
? ctx = Application.
ThreadContext
.FromId(threadId);
9420
/// See <see cref="Application.
ThreadContext
.PreTranslateMessage(ref MSG)"/>.
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (4)
1921
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(_restoreFocusFilter);
3290
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(RestoreFocusFilter);
3975
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(RestoreFocusFilter);
4669
Application.
ThreadContext
.FromCurrent().AddMessageFilter(RestoreFocusFilter);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.RestoreFocusMessageFilter.cs (1)
58
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(this);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (2)
364
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(ParentInternal.RestoreFocusFilter);
377
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(ParentInternal.RestoreFocusFilter);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (5)
138
Application.
ThreadContext
.FromCurrent().AddMessageFilter(this);
139
Application.
ThreadContext
.FromCurrent().TrackInput(true);
141
if (!Application.
ThreadContext
.FromCurrent().GetMessageLoop(true))
185
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(this);
186
Application.
ThreadContext
.FromCurrent().TrackInput(false);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.HostedWindowsFormsMessageHook.cs (1)
91
if (Application.
ThreadContext
.FromCurrent().PreTranslateMessage(ref *msg))
System\Windows\Forms\NativeWindow.cs (2)
108
Application.
ThreadContext
? context = Application.
ThreadContext
.FromId(id);
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (1)
30
_controlToSendTo = Application.
ThreadContext
.FromCurrent().MarshallingControl;