DtsContainer.AcceptBreakpointManager(BreakpointManager) 方法

定义

在创建任务或容器时由运行时引擎调用此方法,并且为其传递 BreakpointManager 管理器,以便使任务能够创建、删除和检查断点的状态。 此方法由运行时调用,在代码中未使用。

public:
 virtual void AcceptBreakpointManager(Microsoft::SqlServer::Dts::Runtime::BreakpointManager ^ breakpointManager);
public void AcceptBreakpointManager (Microsoft.SqlServer.Dts.Runtime.BreakpointManager breakpointManager);
abstract member AcceptBreakpointManager : Microsoft.SqlServer.Dts.Runtime.BreakpointManager -> unit
override this.AcceptBreakpointManager : Microsoft.SqlServer.Dts.Runtime.BreakpointManager -> unit
Public Sub AcceptBreakpointManager (breakpointManager As BreakpointManager)

参数

breakpointManager
BreakpointManager

要用于控制此任务或容器上的断点的 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  

注解

此方法包含一个 BreakpointManager 对象,该对象由任务用来创建和管理其断点。 有关详细信息,请参阅 在自定义任务中添加对调试的支持

适用于