コード例 #1
0
        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());
                }
            }
        }
コード例 #2
0
		void UpdateSearchEntry ()
		{
			if (oldPattern != SearchPattern) {
				oldPattern = SearchPattern;
				SetSearchOptions ();
				result = textEditor.SearchForward (textEditor.Document.LocationToOffset (caretSave));
			}
			
			GotoResult (result);
			UpdateResultInformLabel ();
		}
コード例 #3
0
		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) {
			}
		}
コード例 #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));
		}
コード例 #5
0
		public override void Replace (SearchResult result, string pattern)
		{
			textEditorData.Replace (result.Offset, result.Length, pattern);
		}
コード例 #6
0
		public abstract void Replace (SearchResult result, string pattern);
コード例 #7
0
		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) { 
			}
		}