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
85 references to ThreadContext
System.Windows.Forms (85)
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)
82
public static bool AllowQuit =>
ThreadContext
.GetAllowQuit();
240
=>
ThreadContext
.FromCurrent().CustomThreadExceptionHandlerAttached;
437
=>
ThreadContext
.FromCurrent().GetMessageLoop();
549
=>
ThreadContext
.FromCurrent().RegisterMessageLoop(callback);
597
=>
ThreadContext
.FromCurrent().RegisterMessageLoop(null);
770
=>
ThreadContext
.FromCurrent().AddMessageFilter(value);
780
bool processed =
ThreadContext
.FromCurrent().ProcessFilters(ref msg, out bool modified);
800
ThreadContext
current =
ThreadContext
.FromCurrent();
809
ThreadContext
current =
ThreadContext
.FromCurrent();
825
ThreadContext
current =
ThreadContext
.FromCurrent();
833
ThreadContext
current =
ThreadContext
.FromCurrent();
849
ThreadContext
current =
ThreadContext
.FromCurrent();
857
ThreadContext
current =
ThreadContext
.FromCurrent();
872
ThreadContext
current =
ThreadContext
.FromCurrent();
880
ThreadContext
current =
ThreadContext
.FromCurrent();
904
=>
ThreadContext
.FromCurrent().BeginModalMessageLoop(null);
910
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.DoEvents, null);
913
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.DoEventsModal, null);
954
=>
ThreadContext
.FromCurrent().EndModalMessageLoop(null);
1042
ThreadContext
.ExitApplication();
1060
ThreadContext
context =
ThreadContext
.FromCurrent();
1080
ThreadContext
.FromCurrent().FormActivated(activated);
1140
internal static unsafe
ThreadContext
GetContextForHandle<T>(T handle) where T : IHandle<HWND>
1142
ThreadContext
? threadContext =
ThreadContext
.FromId(PInvokeCore.GetWindowThreadProcessId(handle.Handle, null));
1222
ThreadContext
threadContext =
ThreadContext
.FromCurrent();
1233
=>
ThreadContext
.FromCurrent().OleRequired();
1239
=>
ThreadContext
.FromCurrent().OnThreadException(t);
1247
ThreadContext
threadContext = GetContextForHandle(handle);
1256
=>
ThreadContext
.FromCurrent()._idleHandler?.Invoke(Thread.CurrentThread, e);
1262
=>
ThreadContext
.FromCurrent().RemoveMessageFilter(value);
1311
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.Main, new ApplicationContext());
1318
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.Main, new ApplicationContext(mainForm));
1325
=>
ThreadContext
.FromCurrent().RunMessageLoop(msoloop.Main, context);
1333
=>
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 (9)
25
private static readonly Dictionary<uint,
ThreadContext
> s_contextHash = [];
34
private static
ThreadContext
? t_currentThreadContext;
450
ThreadContext
[] contexts = new
ThreadContext
[s_contextHash.Values.Count];
497
internal static
ThreadContext
FromCurrent() => t_currentThreadContext ?? Create();
499
private static
ThreadContext
Create()
501
ThreadContext
context = LocalAppContextSwitches.EnableMsoComponentManager
511
internal static
ThreadContext
? FromId(uint id)
513
if (!s_contextHash.TryGetValue(id, out
ThreadContext
? context) && id == PInvokeCore.GetCurrentThreadId())
System\Windows\Forms\Application.ThreadWindows.cs (1)
62
Control? activatingControl =
ThreadContext
.FromCurrent().ActivatingControl;
System\Windows\Forms\Control.cs (4)
912
Application.
ThreadContext
.FromCurrent().ActivatingControl = value ? this : null;
3466
Application.
ThreadContext
? ctx = Application.
ThreadContext
.FromId(threadId);
8612
/// See <see cref="Application.
ThreadContext
.PreTranslateMessage(ref MSG)"/>.
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (4)
1927
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(_restoreFocusFilter);
3296
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(RestoreFocusFilter);
3974
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(RestoreFocusFilter);
4629
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)
144
Application.
ThreadContext
.FromCurrent().AddMessageFilter(this);
145
Application.
ThreadContext
.FromCurrent().TrackInput(true);
147
if (!Application.
ThreadContext
.FromCurrent().GetMessageLoop(true))
194
Application.
ThreadContext
.FromCurrent().RemoveMessageFilter(this);
195
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;