BreakpointTargetEnumerator.Current Property
Gets the current BreakpointTarget object in the collection.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public ReadOnly Property Current As BreakpointTarget
public BreakpointTarget Current { get; }
public:
property BreakpointTarget^ Current {
BreakpointTarget^ get ();
}
/** @property */
public BreakpointTarget get_Current ()
public function get Current () : BreakpointTarget
속성 값
The current BreakpointTarget object in the collection.
주의
After an enumerator is created, or after a call to the Reset method, the MoveNext method must be called to advance the enumerator to the first element of the collection before reading the value of the Current property; otherwise, Current is unknown and throws an exception.
Current also throws an exception if the last call to MoveNext returned false, which indicates the end of the collection.
Current does not move the position of the enumerator, and consecutive calls to Current return the same object until either MoveNext or Reset is called.
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is invalidated and irrecoverable, thus the next call to MoveNext or Reset throws an InvalidOperationException. If the collection is modified between MoveNext and Current, Current returns the element that it is set to, even if the enumerator is already invalidated.
예
The following code sample creates an enumerator, then uses the Current and MoveNext methods to navigate over the collection.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;
namespace BreakpointTarget_Expression
{
class Program
{
static void Main(string[] args)
{
Package pkg = new Package();
TaskHost taskHost = (TaskHost)pkg.Executables.Add("STOCK:FileSystemTask");
BreakpointTargets bptargets = pkg.GetBreakpointTargets(taskHost, false);
// Create the enumerator.
BreakpointTargetEnumerator myEnumerator = bptargets.GetEnumerator();
Console.WriteLine("The collection contains the following values:");
int i = 0;
while ((myEnumerator.MoveNext()) && (myEnumerator.Current != null))
Console.WriteLine("[{0}] {1}", i++, myEnumerator.Current.Description);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask
Namespace BreakpointTarget_Expression
Class Program
Shared Sub Main(ByVal args() As String)
Dim pkg As Package = New Package()
Dim taskHost As TaskHost = CType(pkg.Executables.Add("STOCK:FileSystemTask"), TaskHost)
Dim bptargets As BreakpointTargets = pkg.GetBreakpointTargets(taskHost,False)
' Create the enumerator.
Dim myEnumerator As BreakpointTargetEnumerator = bptargets.GetEnumerator()
Console.WriteLine("The collection contains the following values:")
Dim i As Integer = 0
While (myEnumerator.MoveNext()) &&(myEnumerator.Current <> Nothing)
Console.WriteLine("[{0}] {1}",i = Console.WriteLine("[{0}] {1}",i + 1
End While
End Sub
End Class
End Namespace
Sample Output:
The collection contains the following values:
[0] Break when the container receives the OnPreExecute event
[1] Break when the container receives the OnPostExecute event
[2] Break when the container receives the OnError event
[3] Break when the container receives the OnWarning event
[4] Break when the container receives the OnInformation event
[5] Break when the container receives the OnTaskFailed event
[6] Break when the container receives the OnProgress event
[7] Break when the container receives the OnQueryCancel event
[8] Break when the container receives the OnVariableValueChanged event
[9] Break when the container receives the OnCustomEvent event
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
BreakpointTargetEnumerator Class
BreakpointTargetEnumerator Members
Microsoft.SqlServer.Dts.Runtime Namespace