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(); } } }
private void m_DockingManager_ActiveContentChanged(object sender, EventArgs e) { var content = m_DockingManager.ActiveContent as SqDocument; if (content != null) { ActiveDocument = content as SqDocument; } }
void layoutDoc_Closed(object sender, EventArgs e) { var doc = (sender as LayoutDocument); if (doc.Content != null && ActiveDocument == doc.Content) { ActiveDocument = null; } }
void OpenDocument(string fileName) { SqDocument doc = new SqDocument(fileName); Xceed.Wpf.AvalonDock.Layout.LayoutDocument layoutDoc = new Xceed.Wpf.AvalonDock.Layout.LayoutDocument(); layoutDoc.Content = doc; layoutDoc.Closed += layoutDoc_Closed; m_CodeDocumentPane.InsertChildAt(0, layoutDoc); doc.Loaded += (s, e) => { layoutDoc.Title = System.IO.Path.GetFileName(doc.DocumentFileName); }; m_DockingManager.ActiveContent = doc; }
void SaveDocument(SqDocument doc) { doc.Save(); }