언어

DtsContainer.DebugMode 속성

정의

객체가 DtsContainer 디버그 모드에 있는지, 실행 중 이벤트를 발생 OnBreakpointHit(IDTSBreakpointSite, BreakpointTarget) 시켜야 하는지 여부를 나타내는 불리언을 받거나 설정합니다.

public:
 property bool DebugMode { bool get(); void set(bool value); };
public bool DebugMode { get; set; }
member this.DebugMode : bool with get, set
Public Property DebugMode As Boolean

속성 값

true는 객체가 디버그 모드에 있음을 나타내며 이벤트를 OnBreakpointHit(IDTSBreakpointSite, BreakpointTarget) 발화합니다.

구현

예제

클래스는 Package 의 상속을 통해 를 DtsContainer 구현합니다.EventsProvider 다음 코드 예시는 패키지를 생성한 후 에서 상속받은 DtsContainer값을 표시하고 설정합니다.

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

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // The package is the ExecuteProcess package sample   
            // that is installed with the SSIS samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p1 = app.LoadPackage(pkg, null);  

            // Show the properties inherited from DtsContainer.  
            Console.WriteLine("CreationName:    {0}", p1.CreationName);  
            Console.WriteLine("DebugMode:       {0}", p1.DebugMode);  
            Console.WriteLine("DelayValidation: {0}", p1.DelayValidation);  
            Console.WriteLine("Description:     {0}", p1.Description);  
            Console.WriteLine("Disable:         {0}", p1.Disable);  

            // Description is not set for this sample, so set it.  
            p1.Description = "This is the Execute Process Package Sample";  
            Console.WriteLine("Description after modification: {0}", p1.Description);  

            Console.WriteLine();  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            ' The package is the ExecuteProcess package sample   
            ' that is installed with the SSIS samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p1 As Package =  app.LoadPackage(pkg,Nothing)   

            ' Show the properties inherited from DtsContainer.  
            Console.WriteLine("CreationName:    {0}", p1.CreationName)  
            Console.WriteLine("DebugMode:       {0}", p1.DebugMode)  
            Console.WriteLine("DelayValidation: {0}", p1.DelayValidation)  
            Console.WriteLine("Description:     {0}", p1.Description)  
            Console.WriteLine("Disable:         {0}", p1.Disable)  

            ' Description is not set for this sample, so set it.  
            p1.Description = "This is the Execute Process Package Sample"  
            Console.WriteLine("Description after modification: {0}", p1.Description)  

            Console.WriteLine()  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

크리에이션 이름: MSDTS. 패키지.1

디버그모드: 거짓

지연검증: 참

설명:

비활성화: 거짓

수정 후 설명: 이것은 프로세스 실행 패키지 샘플입니다

설명

이 함수는 IsBreakpointTargetEnabled 작업이 코드의 브레이크포인트를 만날 때마다 호출됩니다. 브레이크포인트 대상이 활성화되었는지 확인하기 위해 함수 IsBreakpointTargetEnabled 를 호출하는 데 반복적으로 호출할 때 비용이 많이 들기 때문에, 이 DebugMode 플래그는 덮어쓰여 각 상속 클래스가 해당 실행 파일을 디버깅할지 여부를 알려주는 데 사용됩니다. 이 플래그가 로 설정 false되면 작업은 활성화된 브레이크포인트 검사 호출을 피할 수 있습니다. 의 true 값은 작업이 활성화된 끊김 지점을 검사해야 함을 나타내며, 는 검사할 때 IsBreakpointTargetEnabled 입니다.

적용 대상