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

属性值

Boolean

如果为 true,则指示对象处于调试模式并引发 OnBreakpointHit(IDTSBreakpointSite, BreakpointTarget) 事件。

实现

示例

PackageDtsContainer 通过其的继承实现 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  

示例输出:

CreationName: MSDTS。Package。1

DebugMode: False

DelayValidation: True

说明:

禁用: False

修改后的说明:这是执行进程包示例

注解

IsBreakpointTargetEnabled每次任务遇到其代码中的断点时,都会调用函数。 由于调用函数 IsBreakpointTargetEnabled 来查看重复调用时是否启用了断点目标,因此 DebugMode 每个继承类将重写并使用该标志,以指示是否要调试该可执行文件。 如果此标志设置为 false ,任务可以避免调用以检查是否有已启用的断点。 值为 true 指示任务应检查已启用的断点,如果选中,则为 IsBreakpointTargetEnabled

适用于