WmiDataReaderTask.AcceptBreakpointManager(BreakpointManager) 方法

定义

BreakpointManager 引用传递到 WmiDataReaderTask 任务。 此方法由运行时调用,在代码中未使用。

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

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  

适用于