次の方法で共有


XMLTask.SuspendRequired Property

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

名前空間: Microsoft.SqlServer.Dts.Tasks.XMLTask
アセンブリ: Microsoft.SqlServer.XMLTask (microsoft.sqlserver.xmltask.dll 内)

構文

'宣言
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)

プロパティ値

タスクを中断する場合は true です。

解説

プロパティはコード内では設定されません。ブレークポイントに到達したときにタスクおよびコンテナに対してランタイムで設定されます。

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

使用例

次のコードは、カスタム タスクのオーバーライドされた 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

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

XMLTask Class
XMLTask Members
Microsoft.SqlServer.Dts.Tasks.XMLTask Namespace