-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDesktopThread.cs
More file actions
42 lines (37 loc) · 1.3 KB
/
DesktopThread.cs
File metadata and controls
42 lines (37 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
namespace PCLExt.Thread
{
/// <summary>
///
/// </summary>
public class DesktopThread : IThread
{
private readonly System.Threading.Thread _thread;
/// <summary>
///
/// </summary>
public string Name { get { return _thread.Name; } set { _thread.Name = value; } }
/// <summary>
///
/// </summary>
public bool IsBackground { get { return _thread.IsBackground; } set { _thread.IsBackground = value; } }
/// <summary>
///
/// </summary>
public bool IsRunning => _thread.ThreadState != System.Threading.ThreadState.Stopped;
internal DesktopThread(ThreadStart action) { _thread = new System.Threading.Thread(new System.Threading.ThreadStart(action)); }
internal DesktopThread(ParameterizedThreadStart action) { _thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(action)); }
/// <summary>
///
/// </summary>
public void Start() { _thread.Start(); }
/// <summary>
///
/// </summary>
/// <param name="obj"></param>
public void Start(object obj) { _thread.Start(obj); }
/// <summary>
///
/// </summary>
public void Abort() { _thread.Abort(); }
}
}