void m_VM_OnDebugCallback(DebugHookType type, string sourceName, string funcName, int line) { //FIXME: Only checking ActiveDocument since we only compile/run that single file for nows. SqDocument activeDocument = null; Dispatcher.BeginInvoke( (ThreadStart) delegate { activeDocument = ActiveDocument; }, System.Windows.Threading.DispatcherPriority.Send).Wait(); if (activeDocument != null && activeDocument.DocumentFileName == sourceName) { if (activeDocument.HandleBreakPoint(type, funcName, line)) { Dispatcher.BeginInvoke( (ThreadStart) delegate { OnScriptThreadPause(); }, System.Windows.Threading.DispatcherPriority.Send).Wait(); m_BreakPointLock.WaitOne(); } } }