本文整理汇总了C#中Mono.Debugging.Client.BreakEventInfo.IncrementHitCount方法的典型用法代码示例。如果您正苦于以下问题:C# BreakEventInfo.IncrementHitCount方法的具体用法?C# BreakEventInfo.IncrementHitCount怎么用?C# BreakEventInfo.IncrementHitCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Debugging.Client.BreakEventInfo
的用法示例。
在下文中一共展示了BreakEventInfo.IncrementHitCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyBreakEventUpdate
void NotifyBreakEventUpdate (BreakEventInfo binfo, int hitCount, string lastTrace)
{
bool notify = false;
WaitCallback nc = delegate {
if (hitCount != -1)
binfo.IncrementHitCount ();
if (lastTrace != null)
binfo.UpdateLastTraceValue (lastTrace);
};
lock (breakUpdates)
{
int span = (int) (DateTime.Now - lastBreakEventUpdate).TotalMilliseconds;
if (span >= BreakEventUpdateNotifyDelay && !breakUpdateEventsQueued) {
// Last update was more than 0.5s ago. The update can be sent.
lastBreakEventUpdate = DateTime.Now;
notify = true;
} else {
// Queue the event notifications to avoid wasting too much time
breakUpdates [(int)binfo.Handle] = nc;
if (!breakUpdateEventsQueued) {
breakUpdateEventsQueued = true;
ThreadPool.QueueUserWorkItem (delegate {
Thread.Sleep (BreakEventUpdateNotifyDelay - span);
List<WaitCallback> copy;
lock (breakUpdates) {
copy = new List<WaitCallback> (breakUpdates.Values);
breakUpdates.Clear ();
breakUpdateEventsQueued = false;
lastBreakEventUpdate = DateTime.Now;
}
foreach (WaitCallback wc in copy)
wc (null);
});
}
}
}
if (notify)
nc (null);
}