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 物件,此物件會由工作用來建立和管理中斷點。 如需詳細資訊,請參閱 在自訂工作中加入偵錯工具的支援

適用於