MessageEnumerator.Current Property

Definition

Gets the current Message that this enumerator points to.

public System.Messaging.Message Current { get; }

Property Value

The current message.

Exceptions

You called Current before the first call to MoveNext(). The cursor is located before the first element of the message enumeration.

-or-

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

The message the enumerator is currently pointing to no longer exists. It might have been deleted.

Remarks

When the enumerator is created, it points to the head of the queue, at a location before the first message. In this case, Current is not valid and will throw an exception if it is accessed. You must call MoveNext to position the cursor at the first message in the queue.

Applies to

Produs Versiuni
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also