root / trunk / hammock / src / net35 / Hammock / Web / WebQueryAsyncResult.cs @ 0eea575a
History | View | Annotate | Download (1.1 kB)
1 |
using System; |
---|---|
2 |
using System.Threading; |
3 |
|
4 |
namespace Hammock.Web |
5 |
{ |
6 |
#if !SILVERLIGHT |
7 |
[Serializable] |
8 |
#endif |
9 |
public class WebQueryAsyncResult : IAsyncResult, IDisposable |
10 |
{ |
11 |
public virtual bool IsCompleted { get; protected internal set; } |
12 |
public virtual WaitHandle AsyncWaitHandle { get; protected internal set; } |
13 |
public virtual object AsyncState { get; protected internal set; } |
14 |
public virtual bool CompletedSynchronously { get; protected internal set; } |
15 |
|
16 |
public virtual IAsyncResult InnerResult { get; set; } |
17 |
public virtual object Tag { get; set; } |
18 |
|
19 |
#if !SILVERLIGHT |
20 |
[NonSerialized] |
21 |
#endif |
22 |
private AutoResetEvent _block; |
23 |
|
24 |
public WebQueryAsyncResult() |
25 |
{ |
26 |
Initialize(); |
27 |
} |
28 |
|
29 |
private void Initialize() |
30 |
{ |
31 |
_block = new AutoResetEvent(false); |
32 |
AsyncWaitHandle = _block; |
33 |
} |
34 |
|
35 |
protected internal void Signal() |
36 |
{ |
37 |
_block.Set(); |
38 |
} |
39 |
|
40 |
public void Dispose() |
41 |
{ |
42 |
|
43 |
} |
44 |
} |
45 |
} |