Visual Basic (Declaration) | |
---|---|
Public Overloads Sub AddWork( _ ByVal item As IWaitAndContinue _ ) |
C# | |
---|---|
public void AddWork( IWaitAndContinue item ) |
Parameters
- item
Exception | Description |
---|---|
System.ObjectDisposedException | The exception that is thrown when an operation is performed on a disposed object. |
Library/Library.Test/TestWaitAndContinue.cs
C# | Copy Code |
---|---|
WaitAndContinueList work = new WaitAndContinueList(); SampleWork item = new SampleWork(); Assert.IsFalse(item.Disposed); work.AddWork(item); Assert.IsFalse(work.PerformWork(0)); item.Dispose(); Assert.IsFalse(work.PerformWork(0)); item.Completed = true;//Normally this would be set in the Dispose method of the WorkItem, but we are testing Assert.IsFalse(work.PerformWork(0)); Assert.IsTrue(work.IsEmpty); Assert.IsTrue(item.Disposed); |
VB.NET | Copy Code |
---|---|
Dim work As New WaitAndContinueList() Dim item As New SampleWork() Assert.IsFalse(item.Disposed) work.AddWork(item) Assert.IsFalse(work.PerformWork(0)) item.Dispose() Assert.IsFalse(work.PerformWork(0)) item.Completed = True 'Normally this would be set in the Dispose method of the WorkItem, but we are testing Assert.IsFalse(work.PerformWork(0)) Assert.IsTrue(work.IsEmpty) Assert.IsTrue(item.Disposed) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7