MessageQueueEnumerator.Current 屬性


取得列舉型別的目前 MessageQueueGets the current MessageQueue of the enumeration.

 property System::Messaging::MessageQueue ^ Current { System::Messaging::MessageQueue ^ get(); };
public System.Messaging.MessageQueue Current { get; }
member this.Current : System.Messaging.MessageQueue
Public ReadOnly Property Current As MessageQueue


資料指標目前所在的佇列。The queue at which the cursor is currently positioned.


在第一次呼叫 Current 之前,請先呼叫 MoveNext()You called Current before the first call to MoveNext(). 資料指標位於列舉型別中第一個佇列的前面。The cursor is located before the first queue in the enumeration.

-或--or- 您在呼叫 Current 之後呼叫 MoveNext(),會傳回 False (表示游標位於列舉型別最後的佇列之後)。You called Current after a call to MoveNext() had returned false (indicating the cursor is located after the last queue in the enumeration).


建立枚舉器時, 它不會指向任何專案, 因此Current無效, 如果存取, 將會擲回例外狀況。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. 您必須呼叫MoveNext , 將游標放在列舉的第一個佇列中。You must call MoveNext to position the cursor at the first queue in the enumeration.

Current的多個呼叫不MoveNext會呼叫, 將會傳回MessageQueue相同的物件。Multiple calls to Current with no intervening calls to MoveNext will return the same MessageQueue object.