IDTSSuspend.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 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 구현이 새 스레드를 시작하지 않는다는 것을 의미하며, 이 인터페이스를 구현할 필요가 없습니다. 사용자 지정 작업을 작성하는 방법에 대한 자세한 내용은 사용자 지정 작업 개발을 참조하세요.

적용 대상