BreakpointTarget.Owner 属性

定义

为拥有断点的任务返回 IDTSBreakpointSite

public:
 property Microsoft::SqlServer::Dts::Runtime::IDTSBreakpointSite ^ Owner { Microsoft::SqlServer::Dts::Runtime::IDTSBreakpointSite ^ get(); };
public Microsoft.SqlServer.Dts.Runtime.IDTSBreakpointSite Owner { get; }
member this.Owner : Microsoft.SqlServer.Dts.Runtime.IDTSBreakpointSite
Public ReadOnly Property Owner As IDTSBreakpointSite

属性值

一个 IDTSBreakpointSite 接口。

示例

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

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

注解

断点站点是提供断点的任务。 提供断点的任务实现 IDTSBreakpointSite 接口。 此属性 Owner 指向创建断点目标的任务。

适用于