public void UpdateRefResult() { if (m_srcUniqueName == "" || m_isFindingReference || m_searchResultList == null || m_count > m_maxCount) { return; } var dte = Package.GetGlobalService(typeof(DTE)) as DTE2; if (dte == null) { return; } m_isFindingReference = true; // Record current status Document currentDoc = dte.ActiveDocument; var srcSelection = currentDoc.Selection as EnvDTE.TextSelection; string srcPath = currentDoc.FullName; int srcLine = srcSelection.CurrentLine; int srcColumn = srcSelection.CurrentColumn; var scene = UIManager.Instance().GetScene(); var selectedNodes = scene.SelectedNodes(); var selectedUniqueName = ""; if (selectedNodes.Count > 0) { selectedUniqueName = selectedNodes[0].GetUniqueName(); } // Process bool isComplete; ProcessReferenceList(out isComplete); int count = CheckFiles(); if (isComplete && count == 0) { m_searchResultList = null; // no more result } // Restore status scene.AcquireLock(); scene.SelectCodeItem(selectedUniqueName); scene.ReleaseLock(); GoToDocument(srcPath, srcLine, srcColumn); m_count++; if (isComplete) { Logger.Info("Search Completed."); } else if (m_count > m_maxCount) { Logger.Info("Search hasn't completed because max count is reached. Please try again."); } m_isFindingReference = false; }
int IVsLibrary.GetList( uint listType, uint flags, VSOBSEARCHCRITERIA[] pobSrch, out IVsObjectList pplist ) { pplist = null; return(VSConstants.E_NOTIMPL); }
void Clear() { m_searchResultList = null; m_referenceDict.Clear(); m_itemDict.Clear(); m_subList.Clear(); m_processedLine.Clear(); m_srcUniqueName = ""; m_srcLongName = ""; m_srcName = ""; m_count = 0; }
int IVsLibrary.GetList(uint listType, uint flags, VSOBSEARCHCRITERIA[] pobSrch, out IVsObjectList pplist) { pplist = null; return VSConstants.E_NOTIMPL; }