void FTreeViewer_DoubleClick(ModelMapper sender, System.Windows.Forms.MouseEventArgs e) { string file = null; var doc = sender.Model as IDocument; if (doc != null) { file = doc.Location.LocalPath; } else { var reference = sender.Model as IReference; if (reference != null) { var fxReference = reference as FXReference; if (fxReference != null) { file = fxReference.ReferencedDocument.Location.LocalPath; } } } if (file != null) { FEditorFactory.Open(file); } }
void FEditor_LinkClicked(object sender, Link link) { var fileName = link.FileName; if (!File.Exists(fileName)) { var dir = Path.GetDirectoryName(FEditor.TextDocument.Location.LocalPath); fileName = dir.ConcatPath(fileName); } if (File.Exists(fileName)) { if (new Uri(fileName) == FEditor.TextDocument.Location) { MoveTo(link.Location.Line + 1, link.Location.Column + 1); } else { FEditorFactory.Open(fileName, link.Location.Line + 1, link.Location.Column + 1, FAttachedNode, FNode.Window); } } }
void FEditor_LinkClicked(object sender, Link link) { var fileName = link.FileName; if (!File.Exists(fileName)) { var dir = Path.GetDirectoryName(FEditor.TextDocument.LocalPath); fileName = dir.ConcatPath(fileName); } if (File.Exists(fileName)) { if (string.Compare(fileName, FEditor.TextDocument.LocalPath, StringComparison.InvariantCultureIgnoreCase) == 0) { MoveTo(link.Location.Line + 1, link.Location.Column + 1); } else { FEditorFactory.Open(fileName, link.Location.Line + 1, link.Location.Column + 1, FAttachedNode, FNode.Window); } } }