CSharpTest.Net
IsEmpty Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Threading Namespace > WaitAndContinueWorker Class : IsEmpty Property

Glossary Item Box

Returns true if the work queue is empty

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property IsEmpty As Boolean
C# 
public bool IsEmpty {get;}

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.Abort();

    Assert.IsFalse(item.Completed);
    Assert.IsTrue(item.Disposed);
}
VB.NETCopy 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.Abort()

    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

Generated with Document! X 2011 by Innovasys