DebugMode プロパティ

タスクがデバッグ モードであるかどうかを示す Boolean を取得します。値の設定も可能です。DebugMode プロパティには、複数のスレッドが同時にアクセスできます。スレッド セーフを確保し、同時実行の問題を回避するために、Microsoft .NET Framework の Interlocked クラスが使用されます。

名前空間:  Microsoft.SqlServer.Dts.Tasks.WebServiceTask
アセンブリ:  Microsoft.SqlServer.WebServiceTask (Microsoft.SqlServer.WebServiceTask.dll)

構文

'宣言
Public Property DebugMode As Boolean
    Get
    Set
'使用
Dim instance As WebServiceTask
Dim value As Boolean

value = instance.DebugMode

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

プロパティ値

型: System. . :: . .Boolean
タスクがデバッグ モードである場合は true、デバック モードではない場合は false です。

実装

IDTSBreakpointSite. . :: . .DebugMode

説明

Interlocked クラスは、複数のスレッドで共有される変数にアトミックな操作を提供します。変数が共有メモリ内にある場合、異なるプロセスのスレッドはこのメカニズムを使用できます。詳細については、.NET Framework クラス ライブラリの「Interlocked」と「Interlocked クラス」を参照してください。

IsBreakpointTargetEnabled 関数は、タスクがコード内のブレークポイントに到達するたびに呼び出されます。IsBreakpointTargetEnabled 関数を呼び出してブレークポイント ターゲットが有効かどうかを確認すると、繰り返し呼び出した場合に負担が大きいため、DebugMode フラグを使用して、実行可能ファイルをデバッグするかどうかを示します。このフラグを false に設定すると、タスクはブレークポイントが有効かどうかを確認する呼び出しを行いません。値が true の場合、タスクが有効なブレークポイントを確認する必要があることを示し、その場合は IsBreakpointTargetEnabled が確認されます。

使用例

次のコード例では、WebServiceTask を作成し、TaskHost を使用して DebugMode を含むプロパティの既定の設定を示します。その後、2 つのフィールドを設定して、フィールド値の設定方法を示します。

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.WebServiceTask;

namespace Microsoft.SqlServer.SSIS.Samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Package pkg = new Package();
            Executable exec1 = pkg.Executables.Add("STOCK:WebServiceTask");
            TaskHost th = exec1 as TaskHost;

            // List the default values of the Web Service task
            // using the Properties collection of the TaskHost.
            Console.WriteLine("Connection        {0}", th.Properties["Connection"].GetValue(th));
            Console.WriteLine("DebugMode         {0}", th.Properties["DebugMode"].GetValue(th));
            Console.WriteLine("OutputLocation    {0}", th.Properties["OutputLocation"].GetValue(th));
            Console.WriteLine("OutputType        {0}", th.Properties["OutputType"].GetValue(th));
            Console.WriteLine("OverwriteWsdlFile {0}", th.Properties["OverwriteWsdlFile"].GetValue(th));
            Console.WriteLine("ServiceName       {0}", th.Properties["ServiceName"].GetValue(th));
            Console.WriteLine("SuspendRequired   {0}", th.Properties["SuspendRequired"].GetValue(th));
            Console.WriteLine("WebMethodInfo     {0}", th.Properties["WebMethodInfo"].GetValue(th));
            Console.WriteLine("WsdlFile          {0}", th.Properties["WsdlFile"].GetValue(th));

            Console.WriteLine("--------------------------");
            // Show how to set a property using the TaskHost Properties.
            th.Properties["OutputType"].SetValue(th, DTSOutputType.File);
            th.Properties["OverwriteWsdlFile"].SetValue(th, true);

            Console.WriteLine("New value of OutputType and OverwriteWsdlFile: {0}, {1}", th.Properties["OutputType"].GetValue(th), th.Properties["OverwriteWsdlFile"].GetValue(th));
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.WebServiceTask
 
Namespace Microsoft.SqlServer.SSIS.Samples
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim pkg As Package =  New Package() 
            Dim exec1 As Executable =  pkg.Executables.Add("STOCK:WebServiceTask") 
            Dim th As TaskHost =  exec1 as TaskHost 
 
            ' List the default values of the Web Service task
            ' using the Properties collection of the TaskHost.
            Console.WriteLine("Connection        {0}", th.Properties("Connection").GetValue(th))
            Console.WriteLine("DebugMode         {0}", th.Properties("DebugMode").GetValue(th))
            Console.WriteLine("OutputLocation    {0}", th.Properties("OutputLocation").GetValue(th))
            Console.WriteLine("OutputType        {0}", th.Properties("OutputType").GetValue(th))
            Console.WriteLine("OverwriteWsdlFile {0}", th.Properties("OverwriteWsdlFile").GetValue(th))
            Console.WriteLine("ServiceName       {0}", th.Properties("ServiceName").GetValue(th))
            Console.WriteLine("SuspendRequired   {0}", th.Properties("SuspendRequired").GetValue(th))
            Console.WriteLine("WebMethodInfo     {0}", th.Properties("WebMethodInfo").GetValue(th))
            Console.WriteLine("WsdlFile          {0}", th.Properties("WsdlFile").GetValue(th))
 
            Console.WriteLine("--------------------------")
            ' Show how to set a property using the TaskHost Properties.
            th.Properties("OutputType").SetValue(th, DTSOutputType.File)
            th.Properties("OverwriteWsdlFile").SetValue(th, True)
 
            Console.WriteLine("New value of OutputType and OverwriteWsdlFile: {0}, {1}", th.Properties("OutputType").GetValue(th), th.Properties("OverwriteWsdlFile").GetValue(th))
        End Sub
    End Class
End Namespace

サンプルの出力 :

Connection

DebugMode False

OutputLocation

OutputType 0

OverwriteWsdlFile False

ServiceName

SuspendRequired False

WebMethodInfo

WsdlFile

--------------------------

New value of OutputType and OverwriteWsdlFile: 0, True