DataTypeInfoEnumerator.MoveNext 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
열거자를 컬렉션의 다음 요소로 진행합니다.
public:
virtual bool MoveNext();
public bool MoveNext();
abstract member MoveNext : unit -> bool
override this.MoveNext : unit -> bool
Public Function MoveNext () As Boolean
반품
성공을 나타내 MoveNext() 는 불리언입니다. 열거자가 다음 요소로 성공적으로 진행되면 참이고; 거짓은 열거자가 집합의 끝을 넘었다면
구현
예제
다음 코드 예시는 열거자를 생성한 후 , MoveNextReset 메서드를 사용하여 Current컬렉션을 탐색합니다.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace DataTypeInfos_GetEnum_Current
{
class Program
{
static void Main(string[] args)
{
//Create the DataTypeInfos collection.
DataTypeInfos dataInfos = new Application().DataTypeInfos;
//Create the enumerator.
DataTypeInfoEnumerator myEnumerator = dataInfos.GetEnumerator();
Console.WriteLine("The collection contains the following values:");
int i = 0;
DataTypeInfo dtiObject;
while ((myEnumerator.MoveNext()) && (myEnumerator.Current != null))
{
dtiObject = (DataTypeInfo)myEnumerator.Current;
Console.WriteLine("[{0}] {1} {2}", i++, dtiObject.TypeName, dtiObject.TypeEnumName);
}
// Reset puts the index pointer before the beginning
// of the collection.
// Do not retrieve from the collection until MoveNext is called.
myEnumerator.Reset();
myEnumerator.MoveNext();
// Now that the enumerator has been reset, and moved to the
// first item in the collection, show the first item.
dtiObject = (DataTypeInfo)myEnumerator.Current;
Console.WriteLine("The first item in the enumerator after Reset:");
Console.WriteLine("{0}, {1}", dtiObject.TypeName, dtiObject.TypeEnumName);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace DataTypeInfos_GetEnum_Current
Class Program
Shared Sub Main(ByVal args() As String)
'Create the DataTypeInfos collection.
Dim dataInfos As DataTypeInfos = New Application().DataTypeInfos
'Create the enumerator.
Dim myEnumerator As DataTypeInfoEnumerator = dataInfos.GetEnumerator()
Console.WriteLine("The collection contains the following values:")
Dim i As Integer = 0
Dim dtiObject As DataTypeInfo
While (myEnumerator.MoveNext()) &&(myEnumerator.Current <> Nothing)
dtiObject = CType(myEnumerator.Current, DataTypeInfo)
Console.WriteLine("[{0}] {1} {2}",i = Console.WriteLine("[{0}] {1} {2}",i + 1
End While
' Reset puts the index pointer before the beginning
' of the collection.
' Do not retrieve from the collection until MoveNext is called.
myEnumerator.Reset()
myEnumerator.MoveNext()
' Now that the enumerator has been reset, and moved to the
' first item in the collection, show the first item.
dtiObject = CType(myEnumerator.Current, DataTypeInfo)
Console.WriteLine("The first item in the enumerator after Reset:")
Console.WriteLine("{0}, {1}", dtiObject.TypeName, dtiObject.TypeEnumName)
End Sub
End Class
End Namespace
샘플 출력:
이 수집품에는 다음과 같은 값들이 포함되어 있습니다:
[0] 플로팅 DT_R4
[1] 이중 정밀도 플로트 DT_R8
[2] 화폐 DT_CY
[3] 날짜 DT_DATE
[4] 불리언 DT_BOOL
[5] 십진수 DT_DECIMAL
[6] 단일 바이트 부호 정수 DT_I1
[7] 단일 바이트 부호 없는 정수 DT_UI1
[8] 2바이트 부호 있는 정수 DT_I2
[9] 2바이트 부호 없는 정수 DT_UI2
[10] 4바이트 부호 정수 DT_I4
[11] 부호 없는 4바이트 정수 DT_UI4
[12] 8바이트 부호 정수 DT_I8
[13] 8바이트 부호 없는 정수 DT_UI8
[14] 파일 타임스탬프 DT_FILETIME
[15] 고유 식별자 DT_GUID
[16] 바이트 스트림 DT_BYTES
[17] 현 DT_STR
[18] 유니코드 문자열 DT_WSTR
[19] 숫자 DT_NUMERIC
[20] 데이터베이스 날짜 DT_DBDATE
[21] 데이터베이스 DT_DBTIME
[22] 데이터베이스 타임스탬프 DT_DBTIMESTAMP
[23] 이미지 DT_IMAGE
[24] 텍스트 스트림 DT_TEXT
[25] 유니코드 텍스트 스트림 DT_NTEXT
리셋 이후 열거기의 첫 항목:
플로트, DT_R4