Example #1
0
 private static string ComputeIndexString(FileSearchInfo searchInfo)
 {
     string indexString = null;
     if (searchInfo is SymbolFileSearchInfo)
     {
         SymbolFileSearchInfo symSearchInfo = (searchInfo as SymbolFileSearchInfo);
         indexString = symSearchInfo.Signature.ToString().Replace("-", "").ToUpper() +
             symSearchInfo.Age.ToString();
     }
     else if (searchInfo is BinaryFileSearchInfo)
     {
         BinaryFileSearchInfo binarySearchInfo = (searchInfo as BinaryFileSearchInfo);
         indexString = binarySearchInfo.Timestamp.ToString("x").Replace("-", "").ToUpper() +
             binarySearchInfo.Size.ToString("x");
     }
     return indexString;
 }
Example #2
0
        public void Search(string searchPathEntry, FileSearchInfo searchInfo, FileSearchResult result)
        {
            if (searchPathEntry == FileLocator.FirstSearchEntry || searchPathEntry == FileLocator.LastSearchEntry)
                return;
            if (searchInfo.SearchKind == FileSearchInfo.FileSearchKind.Source)
                return;

            // don't search for ngen images on the symbol server, we won't find them
            if (searchInfo.Path.EndsWith(".ni.dll", StringComparison.OrdinalIgnoreCase))
                return;

            string fileName = Path.GetFileName(searchInfo.Path);
            string indexString = ComputeIndexString(searchInfo);

            SymStore store;
            if(searchPathEntry.StartsWith("srv*"))
                store = SymStore.FromPath(searchPathEntry);
            else
                store = SymStore.FromPath(@"srv**" + searchPathEntry);
            string filePath;
            if (store.TryGetFile(fileName, indexString, out filePath))
                result.CreateEntry(filePath);
        }