업데이트: 2007년 11월
ContextLinkCollection에서 열거자가 가리키는 ContextLink 개체를 가져옵니다.
네임스페이스: Microsoft.Ink
어셈블리: Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.dll)
구문
‘선언
Public ReadOnly Property Current As ContextLink
‘사용 방법
Dim instance As ContextLinkCollection..::.ContextLinkCollectionEnumerator
Dim value As ContextLink
value = instance.Current
public ContextLink Current { get; }
public:
property ContextLink^ Current {
ContextLink^ get ();
}
/** @property */
public ContextLink get_Current()
public function get Current () : ContextLink
속성 값
형식: Microsoft.Ink.ContextLink
ContextLinkCollection 에서 열거자가 가리키는 ContextLink 개체입니다.
설명
ContextLinkCollection.ContextLinkCollectionEnumerator 열거자를 만들었거나 Reset 메서드를 호출한 후에는 Current 속성 값을 읽기 전에 MoveNext 메서드를 호출하여 열거자를 컬렉션의 첫 번째 요소로 이동해야 합니다. 이렇게 하지 않으면 Current 속성이 정의되지 않습니다.
MoveNext 메서드를 마지막으로 호출할 때 false가 반환된 경우 Current 속성에서 예외가 throw됩니다. MoveNext 메서드를 마지막으로 호출할 때 false가 반환된 경우 열거자가 ContextLinkCollection의 끝에 도달한 것입니다.
Current 속성은 열거자의 위치를 이동하지 않습니다. Current 속성을 연속해서 호출하면 MoveNext 메서드 또는 Reset 메서드가 호출될 때까지 동일한 개체가 반환됩니다.
열거자는 컬렉션이 변경되지 않은 상태로 유지되는 한 유효합니다. 요소를 추가, 수정 또는 삭제하는 등 컬렉션을 변경하면 열거자가 무효화되며 이러한 상태를 복구할 수 없습니다. 다음 번에 MoveNext 메서드 또는 Reset 메서드를 호출하면 InvalidOperationException 예외가 throw됩니다. MoveNext 메서드를 호출하는 시점과 Current 속성을 호출하는 시점 사이에서 컬렉션이 수정된 경우 Current 속성은 열거자가 이미 무효화된 경우에도 자신이 가리키는 요소를 반환합니다.
예제
이 예제에서는 ContextLinkCollection인 links의 Systems.Collections.IEnumerator를 가져와서 컬렉션에 들어 있는 각 ContextLink 개체를 ArrayList에 배치하는 데 사용합니다.
Dim customLinks As New ArrayList()
' Version using GetEnumerator()
Dim enumerator As ContextLinkCollection.ContextLinkCollectionEnumerator = _
links.GetEnumerator()
enumerator.Reset()
While enumerator.MoveNext()
Dim aLink As ContextLink = CType(enumerator.Current, ContextLink)
customLinks.Add(aLink)
End While
ArrayList customLinks = new ArrayList();
// Version using GetEnumerator()
ContextLinkCollection.ContextLinkCollectionEnumerator
enumerator = links.GetEnumerator();
enumerator.Reset();
while (enumerator.MoveNext())
{
ContextLink aLink = ((ContextLink)enumerator.Current);
customLinks.Add(aLink);
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원
참고 항목
참조
ContextLinkCollection.ContextLinkCollectionEnumerator 클래스