Ejemplo n.º 1
0
 public void UnmarkLine()
 {
     if (MarkedDocument != null)
     {
         MarkedDocument.SetLineMarked(MarkedDocumentLine, false);
         MarkedDocument = null;
     }
 }
Ejemplo n.º 2
0
        public void MarkLine(Project MarkProject, DocumentInfo Document, int Line)
        {
            if (MarkedDocument != null)
            {
                if (MarkedDocument.InvokeRequired)
                {
                    MarkedDocument.Invoke(new Navigating.OpenDocumentAndGotoLineCallback(MarkLine),
                                          new object[] { MarkProject, Document, Line });
                    return;
                }
            }
            UnmarkLine();

            string inPath = Document.FullPath.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;
                }
            }
        }