MessageEnumerator.MoveNext Method (TimeSpan)
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.
Assembly: System.Messaging (in System.Messaging.dll)
Return ValueType: System.Boolean
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.
This overload waits if there is no message in the queue or if the cursor has reached the end of the queue. If a message is not currently available because the queue is empty or because you have moved beyond the last element in the collection, MoveNext waits the specified timeout.
If the cursor is already at the end of the queue, MoveNext only returns true if the new message arrives within the specified time interval, has lower priority than all messages currently in the queue and is placed at the end of the queue. An overload with no parameter returns immediately if no further messages are in the queue.
Upon creation, an enumerator is conceptually positioned before the first message of the enumeration, and the first call to MoveNext brings the first message of the enumeration into view.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.