업데이트: 2007년 11월
[Systems.Collections.IEnumerator] 인터페이스를 구현하며 ContextLinkCollection의 ContextLink 개체를 통해 반복 처리할 수 있는 개체를 반환합니다.
네임스페이스: System.Windows.Ink
어셈블리: IAWinFX(IAWinFX.dll)
구문
‘선언
Public Function GetEnumerator As ContextLinkCollection..::.ContextLinkCollectionEnumerator
‘사용 방법
Dim instance As ContextLinkCollection
Dim returnValue As ContextLinkCollection..::.ContextLinkCollectionEnumerator
returnValue = instance.GetEnumerator()
public ContextLinkCollection..::.ContextLinkCollectionEnumerator GetEnumerator()
public:
ContextLinkCollection..::.ContextLinkCollectionEnumerator^ GetEnumerator()
public ContextLinkCollection..::.ContextLinkCollectionEnumerator GetEnumerator()
public function GetEnumerator() : ContextLinkCollection..::.ContextLinkCollectionEnumerator
반환 값
형식: System.Windows.Ink.ContextLinkCollection.ContextLinkCollectionEnumerator
[Systems.Collections.IEnumerator] 인터페이스를 구현하며 ContextLinkCollection의 ContextLink 개체를 통해 반복 처리할 수 있는 개체입니다.
예제
다음 예제에서는 이름이 links인 ContextLinkCollection을 반복하여 모든 사용자 지정 링크를 이름이 customLinks인 ArrayList에 넣는 두 가지 방법을 보여 줍니다.
이 예제에서는 links라는 ContextLinkCollection에 대한 [Systems.Collections.IEnumerator]를 가져옵니다.
Dim customLinks As New ArrayList()
' Version using GetEnumerator()
Dim enumerator As ContextLinkCollection.ContextLinkCollectionEnumerator _
= links.GetEnumerator()
While enumerator.MoveNext()
Dim link As ContextLink = CType(enumerator.Current, ContextLink)
' Perform some action with each ContextLink.
End While
ArrayList customLinks = new ArrayList();
// Version using GetEnumerator()
ContextLinkCollection.ContextLinkCollectionEnumerator
enumerator = links.GetEnumerator();
while (enumerator.MoveNext())
{
ContextLink link =
((ContextLink)enumerator.Current);
// Perform some action with each ContextLink.
}
이 예제에서는 foreach 문을 사용합니다. 이 문은 내부 코드에서 컴파일러가 이를 지원하기 위해 생성하는 GetEnumerator 메서드를 호출합니다.
' Version using foreach
For Each link As ContextLink In links
Next link
' Perform some action with each ContextLink.
// Version using foreach
foreach (ContextLink link in links)
{
// Perform some action with each ContextLink.
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원