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  

Образец вывода:

CreationName: MSDTS. Package.1

DebugMode: False

DelayValidation: True

Описание.

Отключить: False

Описание после изменения: это пример пакета "Выполнение процесса"

Комментарии

Функция IsBreakpointTargetEnabled вызывается каждый раз, когда задача сталкивается с точкой останова в коде. Так как вызов функции IsBreakpointTargetEnabled для определения того, включен ли целевой объект точки останова дорого при повторном вызове, флаг переопределяется и используется каждым наследующим классом, чтобы указать, DebugMode следует ли отлаживать этот исполняемый файл. Если этот флаг установлен false, задачи могут избежать вызова для проверки включенной точки останова. Значение true указывает, что задача должна проверять наличие включенных точек останова и когда IsBreakpointTargetEnabled выполняется проверка.

Применяется к