Udostępnij za pośrednictwem


Właściwość WebServiceTask.SuspendRequired

Pobiera lub ustawia wartość logiczna wskazująca, że jeżeli zadań należy zawiesić po napotkaniu punktu punkt przerwania.Wartość ta jest zestaw przez aparat wykonywania zadań i pojemników po napotkaniu punktu punkt przerwania.

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Tasks.WebServiceTask
Zestaw:  Microsoft.SqlServer.WebServiceTask (w Microsoft.SqlServer.WebServiceTask.dll)

Składnia

'Deklaracja
Public Property SuspendRequired As Boolean
    Get
    Set
'Użycie
Dim instance As WebServiceTask
Dim value As Boolean

value = instance.SuspendRequired

instance.SuspendRequired = value
public bool SuspendRequired { get; set; }
public:
virtual property bool SuspendRequired {
    bool get () sealed;
    void set (bool value) sealed;
}
abstract SuspendRequired : bool with get, set
override SuspendRequired : bool with get, set
final function get SuspendRequired () : boolean
final function set SuspendRequired (value : boolean)

Wartość właściwości

Typ: System.Boolean
TRUE Jeżeli wstrzymuje zadanie po napotkaniu punktu punkt przerwania.

Implementacje

IDTSSuspend.SuspendRequired

Uwagi

Właściwość nie jest zestaw w kodzie.Jest zestaw w czasie wykonywania zadań i pojemników po napotkaniu punktu punkt przerwania.

Jednakże należy podać kod dla metoda dziedziczone z IDTSSuspend klasy, jeśli piszesz wielowątkowych zadanie niestandardowe miejscami punkty przerwania.Jeśli zadanie jest pojedynczym wątku, co oznacza, że implementacji Execute w niestandardowe zadania nie można uruchomić nowych wątków, nie trzeba zaimplementować interfejs.Aby uzyskać więcej informacji na temat pisania niestandardowych zadań, zobacz Opracowywania niestandardowego zadania.

Przykłady

Poniższy przykład kodu jest przykładem zastąpiona SuspendRequired właściwość niestandardowych zadań.

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