(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Web / Test / TestMonoWeb / AsyncOperation.cs
blob46b0ff1f722fc3e79191d1e990ac8ce3eb3a4015
1 using System;
2 using System.Threading;
3 using System.Web;
5 namespace TestMonoWeb
7 class AsynchOperation : IAsyncResult {
8 private bool _completed;
9 private Object _state;
10 private AsyncCallback _callback;
11 private HttpContext _context;
13 bool IAsyncResult.IsCompleted { get { return _completed; } }
14 WaitHandle IAsyncResult.AsyncWaitHandle { get { return null; } }
15 Object IAsyncResult.AsyncState { get { return _state; } }
16 bool IAsyncResult.CompletedSynchronously { get { return false; } }
18 public HttpContext Context {
19 get {
20 return _context;
24 public AsynchOperation(AsyncCallback callback, HttpContext context, Object state) {
25 _callback = callback;
26 _context = context;
27 _state = state;
28 _completed = false;
31 public void StartAsyncWork() {
32 ThreadPool.QueueUserWorkItem(new WaitCallback(DoSomething), null /*workItemState*/);
35 private void DoSomething(Object workItemState) {
36 // Just for testing..
37 Thread.Sleep(100);
38 _completed = true;
39 _callback(this);