public virtual void OnVisualMarkerClick(FastColoredTextBox tb, VisualMarkerEventArgs args) { if (VisualMarkerClick != null) { VisualMarkerClick(tb, args); } }
private void fctb_VisualMarkerClick(object sender, VisualMarkerEventArgs e) { //is it our style ? if (e.Style == shortCutStyle) { //show popup menu cmMark.Show(fctb.PointToScreen(e.Location)); } }
private void CodeBoxOnSideMarkerClick(object sender, VisualMarkerEventArgs visualMarkerEventArgs) { var clickedLineText = visualMarkerEventArgs.Marker.Text; codeBox.FindNext(clickedLineText, false, false, false, true); var performMatch = Regex.Match(clickedLineText, Constants.Perform, RegexOptions.IgnoreCase); if (performMatch.Success) { codeBox.FindNext(@"^.{7}" + performMatch.Groups[1].Value + @"(\.| +USING| SECTION\.)", false, true, false, true); return; } var gotoMatch = Regex.Match(clickedLineText, Constants.GoTo, RegexOptions.IgnoreCase); if (gotoMatch.Success) { codeBox.FindNext(@"^.{7}" + gotoMatch.Groups[1].Value + @"(\.| +USING)", false, true, false, true); return; } var callmatch = Regex.Match(clickedLineText, Constants.Call, RegexOptions.IgnoreCase); if (callmatch.Success) { var fileRef = FileUtil.Instance.GetFileReferences(callmatch.Groups[4].Value); if (fileRef.Count == 1) { MainWindow.OpenFile(fileRef.First().FilePath); } else if (fileRef.Count > 0) { MessageBox.Show(Resources.MultipleFilesMatchSearch, Resources.MultipleFilesFound, MessageBoxButtons.OK); } else { MessageBox.Show(Resources.FileCouldNotBeFound, Resources.FileNotFound, MessageBoxButtons.OK); } } var copyMatch = Regex.Match(clickedLineText, Constants.Copy, RegexOptions.IgnoreCase); if (copyMatch.Success) { var copyFile = CobolFile.CopyReferences.FirstOrDefault(file => file.ProgramName == copyMatch.Groups["program"].Value); if (copyFile != null) { MainWindow.OpenFile(copyFile.FilePath); } } }