示例#1
0
 private void DoesItemMatch(IVsHierarchy item, uint id, VsProjectItemPath projectItemPath)
 {
     if (DoItemNamesComparison(_input, projectItemPath))
     {
         _foundMatch = true;
     }
 }
示例#2
0
 private static bool DoItemNamesComparison(string input, VsProjectItemPath projectItemPath)
 {
     // If input contains "\" character, the user might want to do search by full path name.
     if (input.Contains("\\"))
     {
         return(projectItemPath.Path.EndsWith(input, StringComparison.OrdinalIgnoreCase));
     }
     else
     {
         return(projectItemPath.RelativePath.EndsWith(input, StringComparison.OrdinalIgnoreCase));
     }
 }
示例#3
0
 private void AddMatchFileInfoToResult(IVsHierarchy item, uint id, VsProjectItemPath projectItemPath)
 {
     if (DoItemNamesComparison(_input, projectItemPath))
     {
         var path = projectItemPath.Path;
         var fi   = new FileInfo(path);
         if (fi.Exists)
         {
             VSFileInfo vsFileInfo;
             vsFileInfo.Path      = path;
             vsFileInfo.ItemId    = id;
             vsFileInfo.Hierarchy = item;
             _paths.Add(vsFileInfo);
         }
     }
 }