public void MarkLine(Project MarkProject, string DocumentFilename, int Line) { if (MarkedDocument != null) { if (MarkedDocument.InvokeRequired) { MarkedDocument.Invoke(new Navigating.OpenDocumentAndGotoLineCallback(MarkLine), new object[] { MarkProject, DocumentFilename, Line }); return; } MarkedDocument.SetLineMarked(MarkedDocumentLine, false); } string inPath = DocumentFilename.Replace("\\", "/"); if (MarkProject != null) { foreach (ProjectElement element in MarkProject.Elements) { string myPath = GR.Path.Append(MarkProject.Settings.BasePath, element.Filename).Replace("\\", "/"); if (String.Compare(myPath, inPath, true) == 0) { BaseDocument doc = MarkProject.ShowDocument(element); MarkedDocument = doc; MarkedDocumentLine = Line; if (doc != null) { doc.SetLineMarked(Line, Line != -1); } return; } } } foreach (IDockContent dockContent in Core.MainForm.panelMain.Documents) { BaseDocument baseDoc = (BaseDocument)dockContent; if (baseDoc.DocumentFilename == null) { continue; } string myPath = baseDoc.DocumentFilename.Replace("\\", "/"); if (String.Compare(myPath, inPath, true) == 0) { MarkedDocument = baseDoc; MarkedDocumentLine = Line; baseDoc.Select(); baseDoc.SetLineMarked(Line, Line != -1); return; } } }
public void ShowDocument(BaseDocument Doc) { if (Doc.InvokeRequired) { Doc.Invoke(new MainForm.DocCallback(ShowDocument), new object[] { Doc }); return; } if (!Doc.Visible) { //Doc.Show(); Doc.Activate(); } if (Doc.Pane != null) { if (Doc.Pane.ActiveContent != Doc) { Doc.Pane.ActiveContent = Doc; } } }