LocalValueEnumerator LocalValueEnumerator LocalValueEnumerator LocalValueEnumerator Struct

定義

為任何存在於 DependencyObject 之相依性屬性的區域數值提供列舉支援。Provides enumeration support for the local values of any dependency properties that exist on a DependencyObject.

public value class LocalValueEnumerator : System::Collections::IEnumerator
public struct LocalValueEnumerator : System.Collections.IEnumerator
type LocalValueEnumerator = struct
    interface IEnumerator
Public Structure LocalValueEnumerator
Implements IEnumerator
繼承
LocalValueEnumeratorLocalValueEnumeratorLocalValueEnumeratorLocalValueEnumerator
實作

備註

區域值」是相依性屬性的值, 它是直接在相依性屬性上設定, SetValue藉由呼叫, 或更多通常是使用在CLRCLR內部呼叫SetValue之屬性包裝函式的 set 存取子。A local value is a value for a dependency property that was set directly on a dependency property, by calling SetValue, or more typically by using the set accessor of a CLRCLR property wrapper that calls SetValue internally. 其他非區域值的屬性系統 determinants 範例, 是透過樣式或相依性屬性預設值所設定的值。Examples of other property system determinants that are not local values are values set through styles, or dependency property default values. 如需詳細資訊,請參閱相依性屬性值優先順序For details, see Dependency Property Value Precedence.

方法會傳回, 並實作為IEnumerator介面。 LocalValueEnumerator GetLocalValueEnumeratorA LocalValueEnumerator is returned by the GetLocalValueEnumerator method and implements the IEnumerator interface. 公用LocalValueEnumerator的函式不存在; 因此, 您必須呼叫GetLocalValueEnumerator來取得這個類別的實例。A public LocalValueEnumerator constructor does not exist; therefore, you must call GetLocalValueEnumerator to obtain an instance of this class.

列舉區域值時, 請勿修改本機SetValueClearValue(藉由呼叫或)。Do not modify local values (by calling SetValue or ClearValue) while enumerating local values. 如果您根據枚舉器所傳回的屬性來變更或清除屬性值, 則變更或清除作業不會使枚舉器集合失效, 這就是許多IEnumerator執行的情況。If you change or clear the property values based on properties that are returned by the enumerator, the change or clear operations do not invalidate the enumerator collection, as is the case for many IEnumerator implementations. 此外, 列舉值視圖也是快照集。Also, the enumerator view is a snapshot. 集合的變更不一定是安全線程, 而且不會強制執行任何鎖定。A change to the collection is not guaranteed to be thread safe, and no lock is enforced. 其他執行緒仍然可以免費存取列舉值以外的內容中的區域數值。Other threads still have free access to the local values from a context other than the enumerator.

如果您的類別中有作業, 請務必瞭解屬性的值是否來自本機值, 請使用此類型。Use this type if you have operations in your class where it is important to know whether a property's value came from a local value. 例如, 在OnPropertyChanged執行中使用此類型, 或您想要在所有本機設定屬性上查詢中繼資料的位置。For example, use this type in an OnPropertyChanged implementation, or where you want to query the metadata on all locally set properties.

屬性

Count Count Count Count

取得集合中表示的項目數。Gets the number of items that are represented in the collection.

Current Current Current Current

取得集合中目前的項目。Gets the current element in the collection.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷提供的 LocalValueEnumerator 是否與這個 LocalValueEnumerator 相等。Determines whether the provided LocalValueEnumerator is equivalent to this LocalValueEnumerator.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回目前 LocalValueEnumerator 的雜湊程式碼。Returns a hash code for the current LocalValueEnumerator.

MoveNext() MoveNext() MoveNext() MoveNext()

將列舉值往前推至下集合中的下一個項目。Advances the enumerator to the next element of the collection.

Reset() Reset() Reset() Reset()

設定列舉值至它的初始位置,這是在集合中第一個項目之前。Sets the enumerator to its initial position, which is before the first element in the collection.

運算子

Equality(LocalValueEnumerator, LocalValueEnumerator) Equality(LocalValueEnumerator, LocalValueEnumerator) Equality(LocalValueEnumerator, LocalValueEnumerator) Equality(LocalValueEnumerator, LocalValueEnumerator)

比較兩個指定的 LocalValueEnumerator 物件是否相同。Compares whether two specified LocalValueEnumerator objects are the same.

Inequality(LocalValueEnumerator, LocalValueEnumerator) Inequality(LocalValueEnumerator, LocalValueEnumerator) Inequality(LocalValueEnumerator, LocalValueEnumerator) Inequality(LocalValueEnumerator, LocalValueEnumerator)

比較兩個指定的 LocalValueEnumerator 物件,判斷它們是否不相同。Compares two specified LocalValueEnumerator objects to determine whether they are not the same.

明確介面實作

IEnumerator.Current IEnumerator.Current IEnumerator.Current IEnumerator.Current

如需這個成員的說明,請參閱 CurrentFor a description of this members, see Current.

適用於

另請參閱