MessageQueueEnumerator::Current Property

 

Gets the current MessageQueue of the enumeration.

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

public:
property MessageQueue^ Current {
	MessageQueue^ get();
}

Property Value

Type: System.Messaging::MessageQueue^

The queue at which the cursor is currently positioned.

Exception Condition
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
Available since 1.1
Return to top
Show: