BreakpointTargets.GetEnumerator Method
BreakpointTargets コレクションを繰り返し処理できる BreakpointTargetEnumerator を返します。
名前空間: Microsoft.SqlServer.Dts.Runtime
アセンブリ: Microsoft.SqlServer.ManagedDTS (microsoft.sqlserver.manageddts.dll 内)
構文
'宣言
Public Function GetEnumerator As BreakpointTargetEnumerator
public BreakpointTargetEnumerator GetEnumerator ()
public:
BreakpointTargetEnumerator^ GetEnumerator ()
public BreakpointTargetEnumerator GetEnumerator ()
public function GetEnumerator () : BreakpointTargetEnumerator
戻り値
BreakpointTargets コレクションの BreakpointTargetEnumerator です。
使用例
次のコード例では、GetEnumerator メソッドを使用して BreakpointTargetEnumerator を作成し、コレクションに対して繰り返し処理を実行します。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.FileSystemTask;
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.FileSystemTask
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
サンプルの出力 :
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
スレッド セーフ
この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォーム
開発プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
対象プラットフォーム
サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。
参照
関連項目
BreakpointTargets Class
BreakpointTargets Members
Microsoft.SqlServer.Dts.Runtime Namespace