BreakpointTarget.HitCount 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定整數,指定中斷點在執行時間引擎暫停之前發生的次數。
public:
property int HitCount { int get(); };
public int HitCount { get; }
member this.HitCount : int
Public ReadOnly Property HitCount As Integer
屬性值
整數,其中包含中斷點在執行時間引擎暫停之前發生的次數。
範例
下列程式碼範例會從封裝中取出中斷點目標集合,並逐一查看中斷點,並顯示每個中斷點的屬性,包括 HitCount 。
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 事件時中斷
已啟用? 否
擊中數0
HitTarget 0
一律 System.windows.media.visualtreehelper.hittest
識別碼-2147483647
TaskHost 的擁有者
備註
如需在使用者介面中設定計數的詳細資訊,請參閱在 工作或容器上設定中斷點來將封裝進行偵錯工具。