共用方式為


ExtendedProperties.ExtendedPropertiesEnumerator.Current 屬性

取得列舉值指向之 ExtendedProperties 集合中的 ExtendedProperty 物件。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public ReadOnly Property Current As ExtendedProperty
'用途
Dim instance As ExtendedProperties..::.ExtendedPropertiesEnumerator
Dim value As ExtendedProperty

value = instance.Current
public ExtendedProperty Current { get; }
public:
property ExtendedProperty^ Current {
    ExtendedProperty^ get ();
}
/** @property */
public ExtendedProperty get_Current()
public function get Current () : ExtendedProperty

屬性值

型別:Microsoft.Ink.ExtendedProperty
列舉值指向之 ExtendedProperties 集合中的 ExtendedProperty 物件。

備註

在建立 ExtendedProperties.ExtendedPropertiesEnumerator 列舉值或呼叫 Reset 方法之後,必須呼叫 MoveNext 方法使列舉值向前移至集合的第一個項目,才能讀取 Current 屬性的值,否則 Current 屬性會是未定義的。

如果上次呼叫 MoveNext 方法傳回 false,則 Current 屬性會擲回例外狀況 (Exception)。如果上次呼叫 MoveNext 方法傳回 false,表示列舉值已經到達 ExtendedProperties 集合的結尾。

Current 屬性不會移動列舉值的位置。在呼叫 MoveNextReset 方法之前,對 Current 屬性的連續呼叫都會傳回相同的物件。

只要集合保持不變,列舉值將保持有效。如果對集合進行變更,例如加入、修改或刪除項目,則列舉值將失效且無法復原。下次呼叫 MoveNextReset 方法會擲回 System.InvalidOperationException (英文) 例外狀況。如果在呼叫 MoveNext 方法和呼叫 Current 屬性之間修改了集合,則 Current 屬性會傳回其所設定的項目,即使列舉值已經失效也一樣。

範例

這個範例會取得 ExtendedProperties 集合的 System.Collections.IEnumerator (英文),並用來列舉集合的每個項目。儘管也適用於其他物件,但在此情況下,ExtendedProperties 集合是由 Stroke.ExtendedProperties 屬性傳回。

Dim propList As ArrayList = New ArrayList()
Dim ienum As IEnumerator = stroke.ExtendedProperties.GetEnumerator()
ienum.Reset()
While ienum.MoveNext()
    Dim prop As ExtendedProperty = DirectCast(ienum.Current, ExtendedProperty)
    propList.Add(prop)
End While
ArrayList propList = new ArrayList();
IEnumerator ienum = stroke.ExtendedProperties.GetEnumerator();
ienum.Reset();
while (ienum.MoveNext())
{
    ExtendedProperty prop = (ExtendedProperty)ienum.Current;
    propList.Add(prop);
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

ExtendedProperties.ExtendedPropertiesEnumerator 類別

ExtendedProperties.ExtendedPropertiesEnumerator 成員

Microsoft.Ink 命名空間

ExtendedProperties

ExtendedProperty

ExtendedProperties.ExtendedPropertiesEnumerator.MoveNext

ExtendedProperties.ExtendedPropertiesEnumerator.Reset

其他資源

System.Collections.IEnumerator