System.Messaging Reference (Document! X Sample)
MoveNext(TimeSpan) Method



System.Messaging Namespace > MessageEnumerator Class > MoveNext Method : MoveNext(TimeSpan) Method
The System.TimeSpan to wait for a message to be available if the enumerator is positioned at the end of the queue.
Advances the enumerator to the next message in the queue. If the enumerator is positioned at the end of the queue, MoveNext waits until a message is available or the given timeout expires.
Syntax
'Declaration
 
Public Overloads Function MoveNext( _
   ByVal timeout As TimeSpan _
) As Boolean
'Usage
 
Dim instance As MessageEnumerator
Dim timeout As TimeSpan
Dim value As Boolean
 
value = instance.MoveNext(timeout)
public bool MoveNext( 
   TimeSpan timeout
)
public:
bool MoveNext( 
   TimeSpan timeout
) 

Parameters

timeout
The System.TimeSpan to wait for a message to be available if the enumerator is positioned at the end of the queue.

Return Value

true if the enumerator successfully advanced to the next message; false if the enumerator has reached the end of the queue and a message does not become available within the time specified by the timeout parameter.
Exceptions
ExceptionDescription
The value specified for the timeout parameter is invalid. It might represent a negative number.
An exception specific to Message Queuing was thrown.-or- The timeout has expired.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

MessageEnumerator Class
MessageEnumerator Members
Overload List