Dreamine.Threading.Wpf
1.0.1
이 패키지는 Worker Thread를 직접 생성하거나 제어하지 않습니다. `IDreamineThreadManager`의 상태만 관찰합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
ThreadInfoRow.cs
이 파일의 문서화 페이지로 가기
1
using
System;
2
using
System.Collections.Generic;
3
using
System.ComponentModel;
4
using
System.Runtime.CompilerServices;
5
using
Dreamine.Threading.Models;
6
7
namespace
Dreamine.Threading.Wpf.ViewModels
8
{
25
public
sealed
class
ThreadInfoRow
: INotifyPropertyChanged
26
{
35
private
DreamineThreadStatus
_status
;
44
private
DreamineThreadPriority
_priority
;
53
private
int
_intervalMs
;
62
private
int
?
_coreIndex
;
71
private
bool
_useAffinity
;
80
private
int
_jobCount
;
89
private
long
_cycleCount
;
98
private
DateTimeOffset?
_startedAt
;
107
private
DateTimeOffset?
_stoppedAt
;
116
private
string
?
_lastErrorMessage
;
117
126
public
event
PropertyChangedEventHandler?
PropertyChanged
;
127
136
public
string
Name
{
get
; }
137
146
public
DreamineThreadStatus
Status
147
{
148
get
=>
_status
;
149
private
set
=> SetField(ref
_status
, value);
150
}
151
160
public
DreamineThreadPriority
Priority
161
{
162
get
=>
_priority
;
163
private
set
=> SetField(ref
_priority
, value);
164
}
165
174
public
int
IntervalMs
175
{
176
get
=>
_intervalMs
;
177
private
set
=> SetField(ref
_intervalMs
, value);
178
}
179
188
public
int
?
CoreIndex
189
{
190
get
=>
_coreIndex
;
191
private
set
=> SetField(ref
_coreIndex
, value);
192
}
193
202
public
bool
UseAffinity
203
{
204
get
=>
_useAffinity
;
205
private
set
=> SetField(ref
_useAffinity
, value);
206
}
207
216
public
int
JobCount
217
{
218
get
=>
_jobCount
;
219
private
set
=> SetField(ref
_jobCount
, value);
220
}
221
230
public
long
CycleCount
231
{
232
get
=>
_cycleCount
;
233
private
set
=> SetField(ref
_cycleCount
, value);
234
}
235
244
public
DateTimeOffset?
StartedAt
245
{
246
get
=>
_startedAt
;
247
private
set
=> SetField(ref
_startedAt
, value);
248
}
249
258
public
DateTimeOffset?
StoppedAt
259
{
260
get
=>
_stoppedAt
;
261
private
set
=> SetField(ref
_stoppedAt
, value);
262
}
263
272
public
string
?
LastErrorMessage
273
{
274
get
=>
_lastErrorMessage
;
275
private
set
=> SetField(ref
_lastErrorMessage
, value);
276
}
277
286
public
bool
IsRunning
=>
Status
== DreamineThreadStatus.Running;
287
296
public
bool
IsPaused
=>
Status
== DreamineThreadStatus.Paused;
297
306
public
bool
IsFaulted
=>
Status
== DreamineThreadStatus.Faulted;
307
332
public
ThreadInfoRow
(DreamineThreadInfo info)
333
{
334
ArgumentNullException.ThrowIfNull(info);
335
336
Name
= info.Name;
337
_status
= info.Status;
338
_priority
= info.Priority;
339
_intervalMs
= info.IntervalMs;
340
_coreIndex
= info.CoreIndex;
341
_useAffinity
= info.UseAffinity;
342
_jobCount
= info.JobCount;
343
_cycleCount
= info.CycleCount;
344
_startedAt
= info.StartedAt;
345
_stoppedAt
= info.StoppedAt;
346
_lastErrorMessage
= info.LastErrorMessage;
347
}
348
381
public
bool
UpdateFrom
(DreamineThreadInfo info)
382
{
383
ArgumentNullException.ThrowIfNull(info);
384
385
var statusChanged =
_status
!= info.Status;
386
var anyChanged =
false
;
387
388
anyChanged |= SetField(ref
_status
, info.Status, nameof(
Status
));
389
anyChanged |= SetField(ref
_priority
, info.Priority, nameof(
Priority
));
390
anyChanged |= SetField(ref
_intervalMs
, info.IntervalMs, nameof(
IntervalMs
));
391
anyChanged |= SetField(ref
_coreIndex
, info.CoreIndex, nameof(
CoreIndex
));
392
anyChanged |= SetField(ref
_useAffinity
, info.UseAffinity, nameof(
UseAffinity
));
393
anyChanged |= SetField(ref
_jobCount
, info.JobCount, nameof(
JobCount
));
394
anyChanged |= SetField(ref
_cycleCount
, info.CycleCount, nameof(
CycleCount
));
395
anyChanged |= SetField(ref
_startedAt
, info.StartedAt, nameof(
StartedAt
));
396
anyChanged |= SetField(ref
_stoppedAt
, info.StoppedAt, nameof(
StoppedAt
));
397
anyChanged |= SetField(ref
_lastErrorMessage
, info.LastErrorMessage, nameof(
LastErrorMessage
));
398
399
if
(statusChanged)
400
{
401
OnPropertyChanged
(nameof(
IsRunning
));
402
OnPropertyChanged
(nameof(
IsPaused
));
403
OnPropertyChanged
(nameof(
IsFaulted
));
404
}
405
406
return
anyChanged;
407
}
408
457
private
bool
SetField<T>
(ref T field, T value, [CallerMemberName]
string
? propertyName =
null
)
458
{
459
if
(EqualityComparer<T>.Default.Equals(field, value))
460
{
461
return
false
;
462
}
463
464
field = value;
465
OnPropertyChanged
(propertyName);
466
return
true
;
467
}
468
485
private
void
OnPropertyChanged
(
string
? propertyName)
486
{
487
PropertyChanged
?.Invoke(
this
,
new
PropertyChangedEventArgs(propertyName));
488
}
489
}
490
}
Dreamine.Threading.Wpf.ViewModels
Definition
DreamineThreadMonitorViewModel.cs:16
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.StoppedAt
DateTimeOffset? StoppedAt
Definition
ThreadInfoRow.cs:259
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._lastErrorMessage
string? _lastErrorMessage
Definition
ThreadInfoRow.cs:116
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.Name
string Name
Definition
ThreadInfoRow.cs:136
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._jobCount
int _jobCount
Definition
ThreadInfoRow.cs:80
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.OnPropertyChanged
void OnPropertyChanged(string? propertyName)
Definition
ThreadInfoRow.cs:485
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.PropertyChanged
PropertyChangedEventHandler? PropertyChanged
Definition
ThreadInfoRow.cs:126
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._intervalMs
int _intervalMs
Definition
ThreadInfoRow.cs:53
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.Priority
DreamineThreadPriority Priority
Definition
ThreadInfoRow.cs:161
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.UpdateFrom
bool UpdateFrom(DreamineThreadInfo info)
Definition
ThreadInfoRow.cs:381
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._cycleCount
long _cycleCount
Definition
ThreadInfoRow.cs:89
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.JobCount
int JobCount
Definition
ThreadInfoRow.cs:217
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.IntervalMs
int IntervalMs
Definition
ThreadInfoRow.cs:175
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._priority
DreamineThreadPriority _priority
Definition
ThreadInfoRow.cs:44
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.SetField< T >
bool SetField< T >(ref T field, T value, [CallerMemberName] string? propertyName=null)
Definition
ThreadInfoRow.cs:457
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._coreIndex
int? _coreIndex
Definition
ThreadInfoRow.cs:62
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.IsFaulted
bool IsFaulted
Definition
ThreadInfoRow.cs:306
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.Status
DreamineThreadStatus Status
Definition
ThreadInfoRow.cs:147
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.CoreIndex
int? CoreIndex
Definition
ThreadInfoRow.cs:189
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._startedAt
DateTimeOffset? _startedAt
Definition
ThreadInfoRow.cs:98
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.IsPaused
bool IsPaused
Definition
ThreadInfoRow.cs:296
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.ThreadInfoRow
ThreadInfoRow(DreamineThreadInfo info)
Definition
ThreadInfoRow.cs:332
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._status
DreamineThreadStatus _status
Definition
ThreadInfoRow.cs:35
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._useAffinity
bool _useAffinity
Definition
ThreadInfoRow.cs:71
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.StartedAt
DateTimeOffset? StartedAt
Definition
ThreadInfoRow.cs:245
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.IsRunning
bool IsRunning
Definition
ThreadInfoRow.cs:286
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.LastErrorMessage
string? LastErrorMessage
Definition
ThreadInfoRow.cs:273
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow._stoppedAt
DateTimeOffset? _stoppedAt
Definition
ThreadInfoRow.cs:107
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.CycleCount
long CycleCount
Definition
ThreadInfoRow.cs:231
Dreamine.Threading.Wpf.ViewModels.ThreadInfoRow.UseAffinity
bool UseAffinity
Definition
ThreadInfoRow.cs:203
ViewModels
ThreadInfoRow.cs
다음에 의해 생성됨 :
1.17.0