Dreamine.Threading.Wpf
1.0.1
이 패키지는 Worker Thread를 직접 생성하거나 제어하지 않습니다. `IDreamineThreadManager`의 상태만 관찰합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
WpfThreadUiDispatcher.cs
이 파일의 문서화 페이지로 가기
1
using
System;
2
using
System.Windows;
3
using
System.Windows.Threading;
4
5
namespace
Dreamine.Threading.Wpf.Services
;
6
15
public
sealed
class
WpfThreadUiDispatcher
:
IThreadUiDispatcher
16
{
25
private
readonly
Dispatcher
_dispatcher
;
26
35
public
Dispatcher
Dispatcher
=>
_dispatcher
;
36
45
public
WpfThreadUiDispatcher
()
46
: this(Application.Current?.
Dispatcher
??
Dispatcher
.CurrentDispatcher)
47
{
48
}
49
74
public
WpfThreadUiDispatcher
(
Dispatcher
dispatcher)
75
{
76
_dispatcher
= dispatcher ??
throw
new
ArgumentNullException(nameof(dispatcher));
77
}
78
103
public
void
Invoke
(Action action)
104
{
105
ArgumentNullException.ThrowIfNull(action);
106
107
if
(
_dispatcher
.CheckAccess())
108
{
109
action();
110
return
;
111
}
112
113
_dispatcher
.Invoke(action);
114
}
115
140
public
void
BeginInvoke
(Action action)
141
{
142
ArgumentNullException.ThrowIfNull(action);
143
144
if
(
_dispatcher
.CheckAccess())
145
{
146
action();
147
return
;
148
}
149
150
_dispatcher
.BeginInvoke(action, DispatcherPriority.Background);
151
}
152
}
Dreamine.Threading.Wpf.Services
Definition
BatchedDispatcher.cs:8
Dreamine.Threading.Wpf.Services.IThreadUiDispatcher
Definition
IThreadUiDispatcher.cs:15
Dreamine.Threading.Wpf.Services.WpfThreadUiDispatcher.Dispatcher
Dispatcher Dispatcher
Definition
WpfThreadUiDispatcher.cs:35
Dreamine.Threading.Wpf.Services.WpfThreadUiDispatcher.WpfThreadUiDispatcher
WpfThreadUiDispatcher(Dispatcher dispatcher)
Definition
WpfThreadUiDispatcher.cs:74
Dreamine.Threading.Wpf.Services.WpfThreadUiDispatcher.BeginInvoke
void BeginInvoke(Action action)
Definition
WpfThreadUiDispatcher.cs:140
Dreamine.Threading.Wpf.Services.WpfThreadUiDispatcher._dispatcher
readonly Dispatcher _dispatcher
Definition
WpfThreadUiDispatcher.cs:25
Dreamine.Threading.Wpf.Services.WpfThreadUiDispatcher.Invoke
void Invoke(Action action)
Definition
WpfThreadUiDispatcher.cs:103
Dreamine.Threading.Wpf.Services.WpfThreadUiDispatcher.WpfThreadUiDispatcher
WpfThreadUiDispatcher()
Definition
WpfThreadUiDispatcher.cs:45
Services
WpfThreadUiDispatcher.cs
다음에 의해 생성됨 :
1.17.0