コード例 #1
0
        /// <summary>
        /// Filters the initial result set by determining which entries actually resolve back to our declaration target.
        /// </summary>
        private void GotoNextMatch(FRResults results, ASResult target)
        {
            IDictionary <String, List <SearchMatch> > initialResultsList = RefactoringHelpera.GetInitialResultsList(results);
            Boolean foundDeclarationSource = false;

            foreach (KeyValuePair <String, List <SearchMatch> > entry in initialResultsList)
            {
                String           currentFileName = entry.Key;
                ScintillaControl sci             = (ScintillaControl)this.AssociatedDocumentHelper.LoadDocument(currentFileName);
                if (back)
                {
                    entry.Value.Reverse();
                }

                foreach (SearchMatch match in entry.Value)
                {
                    // if the search result does point to the member source, store it
                    if (RefactoringHelpera.DoesMatchPointToTarget(sci, match, target, this.AssociatedDocumentHelper))
                    {
                        if (ignoreDeclarationSource && !foundDeclarationSource && RefactoringHelpera.IsMatchTheTarget(sci, match, target))
                        {
                            //ignore the declaration source
                            foundDeclarationSource = true;
                        }
                        else
                        {
                            int ws = sci.PositionFromLine(match.Line - 1) + match.Column;
                            if (!back)
                            {
                                if (ws > curEndPos)
                                {
                                    sci.SelectionStart = ws;
                                    sci.SelectionEnd   = ws + match.Length;
                                    sci.ScrollCaret();
                                    return;
                                }
                            }
                            else
                            {
                                if (ws < curStartPos)
                                {
                                    sci.SelectionStart = ws;
                                    sci.SelectionEnd   = ws + match.Length;
                                    sci.ScrollCaret();
                                    return;
                                }
                            }
                        }
                    }
                }
            }

            Globals.SciControl.SelectionStart = spos;
            Globals.SciControl.SelectionEnd   = epos;
            string str = Globals.SciControl.GetWordFromPosition(spos);

            MessageBox.Show(LocaleHelper.GetString("MESSAGE_NOT_FOUND") + str, "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
コード例 #2
0
 /// <summary>
 /// Entry point to execute finding.
 /// </summary>
 protected override void ExecutionImplementation()
 {
     RefactoringHelpera.FindTargetInCurrentFile(currentTarget, new FRFinishedHandler(this.FindFinished), true);
 }
コード例 #3
0
 /// <summary>
 /// A new FindAllReferences refactoring command.
 /// Uses the current text location as the declaration target.
 /// </summary>
 /// <param name="output">If true, will send the found results to the trace log and results panel</param>
 public GotoSameIdentifierCommand(Boolean output)
     : this(RefactoringHelpera.GetDefaultRefactorTarget(), output)
 {
     this.outputResults = output;
 }