FtpTask.AcceptBreakpointManager(BreakpointManager) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 BreakpointManager 传递给该任务。 此方法由运行时调用,在代码中未使用。
public:
virtual void AcceptBreakpointManager(Microsoft::SqlServer::Dts::Runtime::BreakpointManager ^ manager);
public void AcceptBreakpointManager (Microsoft.SqlServer.Dts.Runtime.BreakpointManager manager);
abstract member AcceptBreakpointManager : Microsoft.SqlServer.Dts.Runtime.BreakpointManager -> unit
override this.AcceptBreakpointManager : Microsoft.SqlServer.Dts.Runtime.BreakpointManager -> unit
Public Sub AcceptBreakpointManager (manager As BreakpointManager)
参数
- manager
- BreakpointManager
特定于此任务的断点管理器。
实现
示例
创建自定义任务时会重写此方法。
接口 IDTSBreakpointSite 定义此方法,该方法由任务继承,在创建任务期间由运行时引擎调用。 该方法采用对象 BreakpointManager 作为参数,然后由每个任务用来创建和管理其断点。
下面的示例代码演示如何在编写自定义任务时重写方法,使用 BreakpointManager 该方法引发事件并调用 OnBreakpointHit
该方法创建断点。 有关详细信息,请参阅 在自定义任务中添加对调试的支持。
public void AcceptBreakpointManager( BreakpointManager breakPointManager )
{
// Store the breakpoint manager locally.
this.bpm = breakPointManager;
// Create a breakpoint.
this.bpm.CreateBreakPoint( 1 , "A sample breakpoint." );
}
public override DTSExecResult Execute( Connections connections, Variables variables, IDTSComponentEvents events, IDTSLogging log, DtsTransaction txn)
{
if( this.bpm.IsBreakpointTargetEnabled( 1 ) == true )
events.OnBreakpointHit( this.bpm.GetBreakpointTarget( 1 ) );
}
Public Sub AcceptBreakpointManager(ByVal breakPointManager As BreakpointManager)
' Store the breakpoint manager locally.
Me.bpm = breakPointManager
' Create a breakpoint.
Me.bpm.CreateBreakPoint(1 , "A sample breakpoint.")
End Sub
Public Overrides Function Execute(ByVal connections As Connections, ByVal variables As Variables, ByVal events As IDTSComponentEvents, ByVal log As IDTSLogging, ByVal txn As DtsTransaction) As DTSExecResult
If Me.bpm.IsBreakpointTargetEnabled(1) = True Then
events.OnBreakpointHit(Me.bpm.GetBreakpointTarget(1))
End If
End Function