void GotoResult(SearchResult result) { try { if (result == null) { textEditor.ClearSelection(); return; } textEditor.StopSearchResultAnimation(); textEditor.Caret.Location = textEditor.OffsetToLocation(result.EndOffset); textEditor.SetSelection(result.Offset, result.EndOffset); textEditor.CenterToCaret(); textEditor.AnimateSearchResult(result); } catch (System.Exception) { } }