private void DoesItemMatch(IVsHierarchy item, uint id, VsProjectItemPath projectItemPath) { if (DoItemNamesComparison(_input, projectItemPath)) { _foundMatch = true; } }
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)); } }
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); } } }