Exits the worker thread and, if complete is true, waits for the remaining tasks to complete
Syntax
Parameters
- complete
- timeout
Example
Library/Library.Test/TestWaitAndContinue.cs
C# | Copy Code |
---|
using (WaitAndContinueWorker work = new WaitAndContinueWorker())
{
work.OnError += delegate(object o, ErrorEventArgs e) { throw new Exception("Failed.", e.GetException()); };
SampleWork item = new SampleWork();
work.AddWork(item);
Assert.IsFalse(work.IsEmpty);
work.Complete(true, 10);
Assert.IsFalse(item.Completed);
Assert.IsTrue(item.Disposed);
} |
VB.NET | Copy Code |
---|
Using work As New WaitAndContinueWorker()
work.OnError += Function(o As Object, e As ErrorEventArgs) Do
Throw New Exception("Failed.", e.GetException())
End Function
Dim item As New SampleWork()
work.AddWork(item)
Assert.IsFalse(work.IsEmpty)
work.Complete(True, 10)
Assert.IsFalse(item.Completed)
Assert.IsTrue(item.Disposed)
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also