DtsContainer.SuspendRequired プロパティ

定義

ブレークポイントが発生したときにタスクを中断する必要があるかどうかを示すブール型 (Boolean) の値を取得または設定します。 この値は、ブレークポイントに到達したときにタスクおよびコンテナーに対してランタイム エンジンで設定されます。

public:
 property bool SuspendRequired { bool get(); void set(bool value); };
public bool SuspendRequired { get; set; }
member this.SuspendRequired : bool with get, set
Public Property SuspendRequired As Boolean

プロパティ値

ブレークポイントが発生したときにタスクが中断した場合は true。

実装

次のコードは、カスタム タスクのオーバーライドされた SuspendRequired プロパティの例です。

public bool SuspendRequired   
{  
     get  
    {   
        // m_suspendRequired is an Private integer declared in the custom task.   
        return m_suspendRequired != 0;   
    }  

    set  
    {  
    // This lock is also taken by Suspend().  Since it is possible for the package to be   
    // suspended and resumed in quick succession, this property "put" might happen   
    // before the actual Suspend() call.  Without the lock, the Suspend() might reset   
    // the canExecute event after we set it to abort the suspension.   
         lock (this)   
    {  
        Interlocked.Exchange(ref m_suspendRequired, value ? 1 : 0);   
            if (!value)   
                ResumeExecution();   
    }  
}  
Public ReadOnly Property SuspendRequired() As Boolean  
    Get   
        ' m_suspendRequired is an Private integer declared in the custom task.   
        Return m_suspendRequired <> 0  
     End Get  

Public WriteOnly Property SuspendRequired() As Boolean  
    Set (ByVal Value As Boolean)   
        ' This lock is also taken by Suspend().  Since it is possible for the package to be   
        ' suspended and resumed in quick succession, this property "put" might happen   
       ' before the actual Suspend() call.  Without the lock, the Suspend() might reset  
       ' the canExecute event after it is set to abort the suspension.   
         lock (Me)  
         {  
               Interlocked.Exchange(m_suspendRequired, value ? 1 : 0)   
                     If Not value Then  
                       ResumeExecution()  
                     End If  
             }  
         End Set  
End Property  

注釈

プロパティはコード内では設定されません。 ブレークポイントが見つかったときに、タスクとコンテナーのランタイムによって設定されます。

ただし、ブレークポイントを公開するマルチスレッド カスタム タスクを作成する場合は、IDTSSuspend クラスから継承されるこのメソッドのコードを指定する必要があります。 タスクがシングル スレッドである場合は、カスタム タスクの実装 Execute で新しいスレッドが開始されないことを意味します。このインターフェイスを実装する必要はありません。 カスタム タスクの記述の詳細については、「カスタム タスク の開発」を参照してください。

適用対象