-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathFrozenThread.cs
More file actions
41 lines (38 loc) · 1.23 KB
/
Copy pathFrozenThread.cs
File metadata and controls
41 lines (38 loc) · 1.23 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
namespace Process.NET.Threads
{
/// <summary>
/// Class containing a frozen thread. If an instance of this class is disposed, its associated thread is resumed.
/// </summary>
public class FrozenThread : IFrozenThread
{
/// <summary>
/// Initializes a new instance of the <see cref="FrozenThread" /> class.
/// </summary>
/// <param name="thread">The frozen thread.</param>
public FrozenThread(IRemoteThread thread)
{
// Save the parameter
Thread = thread;
}
/// <summary>
/// The frozen thread.
/// </summary>
public IRemoteThread Thread { get; }
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
/// TODO Edit XML Comment Template for Dispose
public virtual void Dispose()
{
// Unfreeze the thread
Thread.Resume();
}
/// <summary>
/// Returns a string that represents the current object.
/// </summary>
public override string ToString()
{
return $"Id = {Thread.Id}";
}
}
}