DtsContainer.SuspendExecution Methode

Definition

Wird aufgerufen, wenn das ausführbare Element angehalten werden muss. Diese Methode wird von der Runtime-Engine aufgerufen.

public:
 virtual void SuspendExecution();
public void SuspendExecution ();
abstract member SuspendExecution : unit -> unit
override this.SuspendExecution : unit -> unit
Public Sub SuspendExecution ()

Implementiert

Beispiele

Das folgende Codebeispiel ist ein Beispiel für eine überschriebene SuspendExecution Methode für einen benutzerdefinierten Vorgang.

public void SuspendExecution()   
{  
    lock (this)   
    {  
        // If a suspend is required, do it.   
        if (m_suspendRequired != 0)   
           ChangeEvent(m_canExecute, false);   
        }   

        // The application cannot return from Suspend until the task  
        // is suspended.  
        // This can happen in one of two ways:  
        // 1) The m_suspended event occurs, indicating that the   
        // execute thread has suspended, or   
        // 2) the canExecute flag is set, indicating that a suspend is  
        // no longer required.   
        WaitHandle [] suspendOperationComplete = {m_suspended, m_canExecute};  
        WaitHandle.WaitAny(suspendOperationComplete);  
}  
Public  Sub SuspendExecution()  
    lock (Me)  
    {  
        If m_suspendRequired <> 0 Then  
           ChangeEvent(m_canExecute, False)  
        End If  
    }  
        ' The application cannot return from Suspend until the task  
        ' is suspended. This can happen in one of two ways:  
        ' 1) The m_suspended event occurs, indicating that the   
        ' execute thread has suspended, or   
        ' 2) the canExecute flag is set, indicating that a suspend is  
        ' no longer required.   
        Dim suspendOperationComplete As WaitHandle() = {m_suspended, m_canExecute}  
        WaitHandle.WaitAny(suspendOperationComplete)  

Hinweise

Diese Methode wird nicht im Code verwendet. Es wird von der Laufzeit aufgerufen, wenn ein Haltepunkt aufgetreten ist.

Sie müssen jedoch Code für diese Methode bereitstellen, die von der IDTSSuspend Klasse geerbt wird, wenn Sie einen benutzerdefinierten Vorgang mit mehreren Threads schreiben, der Haltepunkte verfügbar macht. Wenn Ihre Aufgabe single threaded ist, was bedeutet, dass Ihre Implementierung Execute in Ihrer benutzerdefinierten Aufgabe keine neuen Threads startet, müssen Sie diese Schnittstelle nicht implementieren. Weitere Informationen zum Schreiben benutzerdefinierter Aufgaben finden Sie unter Entwickeln einer benutzerdefinierten Aufgabe.

Gilt für: