BreakpointTarget.Enabled 属性

定义

获取或设置一个布尔值,该值指示当前是否启用了特定断点。

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

属性值

一个布尔值,指示是否启用了断点。 true 表示已启用断点;false 表示已禁用。

示例

下面的代码示例从包中检索断点目标集合,并循环访问断点,显示每个断点的属性,包括 Enabled 该属性。

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

namespace Breakpoint_API  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            TaskHost taskHost = (TaskHost)pkg.Executables.Add("STOCK:FileSystemTask");  
            BreakpointTargets bptargets = pkg.GetBreakpointTargets(taskHost, false);  
            foreach (BreakpointTarget bpt in bptargets)  
                {  
                Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString());  
                Console.WriteLine("Description              {0}", bpt.Description);  
                Console.WriteLine("Enabled?                 {0}", bpt.Enabled);  
                Console.WriteLine("HitCount                 {0}", bpt.HitCount);  
                Console.WriteLine("HitTarget                {0}", bpt.HitTarget);  
                Console.WriteLine("HitTest                  {0}", bpt.HitTest);  
                Console.WriteLine("ID                       {0}", bpt.ID);  
                Console.WriteLine("Owner                    {0}", bpt.Owner);  
            }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask  

Namespace Breakpoint_API  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            Dim taskHost As TaskHost = CType(pkg.Executables.Add("STOCK:FileSystemTask"), TaskHost)  
            Dim bptargets As BreakpointTargets =  pkg.GetBreakpointTargets(taskHost,False)   
            Dim bpt As BreakpointTarget  
            For Each bpt In bptargets  
                Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString())  
                Console.WriteLine("Description              {0}", bpt.Description)  
                Console.WriteLine("Enabled?                 {0}", bpt.Enabled)  
                Console.WriteLine("HitCount                 {0}", bpt.HitCount)  
                Console.WriteLine("HitTarget                {0}", bpt.HitTarget)  
                Console.WriteLine("HitTest                  {0}", bpt.HitTest)  
                Console.WriteLine("ID                       {0}", bpt.ID)  
                Console.WriteLine("Owner                    {0}", bpt.Owner)  
            Next  
        End Sub  
    End Class  
End Namespace  

示例输出:

BreakOnExpressionChange? 错误

容器收到 OnPreExecute 事件时的说明中断

是否启用? 错误

HitCount 0

HitTarget 0

HitTest Always

ID -2147483647

所有者 Microsoft.SqlServer.Dts.Runtime.TaskHost

适用于