XMLTask.AcceptBreakpointManager(BreakpointManager) 方法

定义

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  

适用于