ScriptTask.SuspendRequired Property
Gets or sets a Boolean indicating whether a task should suspend execution when the task encounters a breakpoint. This value is set by the run-time engine for tasks and containers when a breakpoint is encountered.
Espacio de nombres: Microsoft.SqlServer.Dts.Tasks.ScriptTask
Ensamblado: Microsoft.SqlServer.ScriptTask (in microsoft.sqlserver.scripttask.dll)
Sintaxis
'Declaración
Public Property SuspendRequired As Boolean
public bool SuspendRequired { get; set; }
public:
virtual property bool SuspendRequired {
bool get () sealed;
void set (bool value) sealed;
}
/** @property */
public final boolean get_SuspendRequired ()
/** @property */
public final void set_SuspendRequired (boolean value)
public final function get SuspendRequired () : boolean
public final function set SuspendRequired (value : boolean)
Valor de propiedad
true if the task suspends execution when it encounters a breakpoint; otherwise, false.
Notas
This property is not set in code. The property is set by the runtime for tasks and containers when a breakpoint is encountered.
However, if you write a multithreaded custom task that exposes breakpoints, you must provide code for this method, which is inherited from the IDTSSuspend class for multithreaded objects. If your task is single threaded, which means that the implementation of Execute in your custom task does not start new threads, you do not have to implement this interface. For more information about writing custom tasks, see Developing a Custom Task.
Ejemplo
The following code example shows how to override the SuspendRequired property for a custom task.
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
Seguridad para subprocesos
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Plataformas
Plataformas de desarrollo
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Plataformas de destino
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Vea también
Referencia
ScriptTask Class
ScriptTask Members
Microsoft.SqlServer.Dts.Tasks.ScriptTask Namespace