This documentation is archived and is not being maintained.

MessageQueueEnumerator.Current Property

Gets the current MessageQueue of the enumeration.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

public MessageQueue Current { get; }

Property Value

Type: System.Messaging.MessageQueue
The queue at which the cursor is currently positioned.

ExceptionCondition
InvalidOperationException

You called Current before the first call to MoveNext. The cursor is located before the first queue in the enumeration.

-or-

You called Current after a call to MoveNext had returned false (indicating the cursor is located after the last queue in the enumeration).

When the enumerator is created, it does not point to anything, so Current is not valid and will throw an exception if it is accessed. You must call MoveNext to position the cursor at the first queue in the enumeration.

Multiple calls to Current with no intervening calls to MoveNext will return the same MessageQueue object.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: