protected static string HighlightMatch(string text, string toMatch) { var lane = !string.IsNullOrEmpty(toMatch) ? NavigateToDialog.MatchString(text, toMatch) : null; if (lane != null) { StringBuilder result = new StringBuilder(); int lastPos = 0; for (int n = 0; n <= lane.Index; n++) { int pos = lane.Positions [n]; int len = lane.Lengths [n]; if (pos - lastPos > 0) { result.Append(GLib.Markup.EscapeText(text.Substring(lastPos, pos - lastPos))); } result.Append("<span foreground=\"blue\">"); result.Append(GLib.Markup.EscapeText(text.Substring(pos, len))); result.Append("</span>"); lastPos = pos + len; } if (lastPos < text.Length) { result.Append(GLib.Markup.EscapeText(text.Substring(lastPos, text.Length - lastPos))); } return(result.ToString()); } return(GLib.Markup.EscapeText(text)); }
protected override void Run() { var dialog = new NavigateToDialog(NavigateToType.Files, false) { Title = GettextCatalog.GetString("Go to File"), }; IEnumerable <NavigateToDialog.OpenLocation> locations = null; try { if (MessageService.RunCustomDialog(dialog, MessageService.RootWindow) == (int)ResponseType.Ok) { dialog.Sensitive = false; locations = dialog.Locations; } } finally { dialog.Destroy(); } if (locations != null) { foreach (var loc in locations) { IdeApp.Workbench.OpenDocument(loc.Filename, loc.Line, loc.Column, true); } } }
protected override void Run () { var dialog = new NavigateToDialog (NavigateToType.All, true); try { if (MessageService.RunCustomDialog (dialog, MessageService.RootWindow) == (int)ResponseType.Ok) { dialog.Sensitive = false; foreach (var loc in dialog.Locations) IdeApp.Workbench.OpenDocument (loc.Filename, loc.Line, loc.Column, true); } } finally { dialog.Destroy (); } }
protected override void Run () { var dialog = new NavigateToDialog (NavigateToType.Files, false) { Title = GettextCatalog.GetString ("Go to File"), }; try { if (MessageService.RunCustomDialog (dialog, MessageService.RootWindow) == (int)ResponseType.Ok) { dialog.Sensitive = false; foreach (var loc in dialog.Locations) IdeApp.Workbench.OpenDocument (loc.Filename, loc.Line, loc.Column, true); } } finally { dialog.Destroy (); } }
protected override void Run () { var dialog = new NavigateToDialog (NavigateToType.All, true); IEnumerable<NavigateToDialog.OpenLocation> locations = null; try { if (MessageService.RunCustomDialog (dialog, MessageService.RootWindow) == (int)ResponseType.Ok) { dialog.Sensitive = false; locations = dialog.Locations; } } finally { dialog.Destroy (); } if (locations != null) { foreach (var loc in locations) IdeApp.Workbench.OpenDocument (loc.Filename, loc.Line, loc.Column, true); } }