private void ReportResult(ISearchProgressMonitor monitor, IEntity result)
        {
            string fileName = result.Region.FileName;

            if (!string.IsNullOrEmpty(fileName))
            {
                TextEditorData textEditorData = TextFileProvider.Instance.GetTextEditorData(fileName);
                int            num            = textEditorData.LocationToOffset(result.Region.Begin);
                textEditorData.SearchRequest.SearchPattern = result.Name;
                Mono.TextEditor.SearchResult searchResult = textEditorData.SearchForward(num);
                if (searchResult != null)
                {
                    num = searchResult.Offset;
                }
                if (textEditorData.Parent == null)
                {
                    textEditorData.Dispose();
                }

                var memberReference = new MemberReference(result, result.Region, num, result.Name.Length);
                _foundMemberReferences.Add(memberReference);

                if (!_didFindFirstResult)
                {
                    _didFindFirstResult     = true;
                    _currentMemberReference = memberReference;
                    NavigateToCurrentDocument();
                }
                else
                {
                    StatusHelper.ShowStatus(MonoDevelop.Ide.Gui.Stock.OpenFileIcon, GetStatusText());
                }
            }
        }
		void UpdateSearchEntry ()
		{
			if (oldPattern != SearchPattern) {
				oldPattern = SearchPattern;
				SetSearchOptions ();
				result = textEditor.SearchForward (textEditor.Document.LocationToOffset (caretSave));
			}
			
			GotoResult (result);
			UpdateResultInformLabel ();
		}
		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) {
			}
		}
Ejemplo n.º 4
0
		public override void Replace (SearchResult result, string pattern)
		{
			string text = this.textEditorData.Document.GetTextAt (result);
			this.textEditorData.Replace (result.Offset, result.Length, regex.Replace (text, pattern));
		}
Ejemplo n.º 5
0
		public override void Replace (SearchResult result, string pattern)
		{
			textEditorData.Replace (result.Offset, result.Length, pattern);
		}
Ejemplo n.º 6
0
		public abstract void Replace (SearchResult result, string pattern);
		void GotoResult (SearchResult result)
		{
			try {
				if (result == null) {
					widget.TextEditor.ClearSelection ();
					return;
				}
				widget.TextEditor.Caret.Offset = result.EndOffset;
				widget.TextEditor.SetSelection (result.Offset, result.EndOffset);
				widget.TextEditor.CenterToCaret ();
				widget.TextEditor.AnimateSearchResult (result);
			} catch (System.Exception) { 
			}
		}