TransferErrorMessagesTask.AcceptBreakpointManager(BreakpointManager) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
允许任务创建、删除和检查断点的状态。 在创建任务或容器时此方法由运行时引擎调用,在代码中未使用。
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