언어

ScriptTask.SuspendRequired 속성

정의

작업이 브레이크포인트에 도달했을 때 실행을 일시 중지해야 하는지 나타내는 불리언을 받거나 설정합니다. 이 값은 브레이크포인트가 발생했을 때 런타임 엔진이 작업과 컨테이너에 대해 설정합니다.

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 a Private integer declared in the custom task.   
        return m_suspendRequired != 0;   
    }  

    set  
    {  
    // This lock is also taken by Suspend().  Because it is possible for the package to be   
    // suspended and resumed in quick succession, this property "set" 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 a 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().  Because 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 (Me)  
         {  
               Interlocked.Exchange(m_suspendRequired, value ? 1 : 0)   
                     If Not value Then  
                       ResumeExecution()  
                     End If  
             }  
         End Set  
End Property  

설명

이 속성은 코드에 설정되어 있지 않습니다. 이 속성은 작업과 컨테이너에 대해 브레이크포인트가 발생했을 때 런타임에 의해 설정됩니다.

하지만 브레이크포인트를 노출하는 멀티스레드 커스텀 작업을 작성한다면, 이 메서드에 대한 코드를 제공해야 하며, 이는 멀티스레드 객체 클래스에서 IDTSSuspend 상속받은 것입니다. 만약 작업이 단일 스레드라면, 즉 커스텀 작업에서 구현 Execute 이 새로운 스레드를 시작하지 않는다면, 이 인터페이스를 구현할 필요가 없습니다. 맞춤형 작업 작성에 대한 자세한 내용은 '맞춤형 작업 개발'을 참조하세요.

적용 대상