MessageQueueEnumerator.MoveNext 方法

定義

如果目前有可用的列舉值,讓列舉值前進至列舉型別的下一個佇列。Advances the enumerator to the next queue of the enumeration, if one is currently available.

public:
 virtual bool MoveNext();
public bool MoveNext ();
abstract member MoveNext : unit -> bool
override this.MoveNext : unit -> bool
Public Function MoveNext () As Boolean

傳回

如果列舉值成功地前移至下一個佇列則為 true,如果列舉值已經到達列舉型別的結尾,則為 falsetrue if the enumerator was successfully advanced to the next queue; false if the enumerator has reached the end of the enumeration.

實作

例外狀況

呼叫程式碼沒有瀏覽權限。The calling code does not have browse permissions.

備註

MoveNext如果沒有與列舉相關聯的佇列, 則會立即傳回。falseMoveNext returns false immediately if there are no queues associated with the enumeration.

MoveNext會傳回, 直到到達集合結尾為止。 trueMoveNext will return true until it has reached the end of the collection. 然後, 它會false針對每個後續的呼叫傳回。It will then return false for each successive call. 不過, MoveNext一旦傳回false, 存取Current屬性將會擲回例外狀況。However once MoveNext has returned false, accessing the Current property will throw an exception.

在建立時, 列舉值在概念上會位於MessageQueue第一個列舉之前, 而第一次MoveNext呼叫會將列舉的第一個佇列帶入 view。Upon creation, an enumerator is conceptually positioned before the first MessageQueue of the enumeration, and the first call to MoveNext brings the first queue of the enumeration into view.

適用於

另請參閱