VisualHg.VisualHgSolution.FindProject C# (CSharp) Method

FindProject() public static method

public static FindProject ( string fileName ) : IVsHierarchy
fileName string
return IVsHierarchy
        public static IVsHierarchy FindProject(string fileName)
        {
            var itemId = VSConstants.VSITEMID_ROOT;

            return LoadedProjects.FirstOrDefault(x => GetItemFiles(x, itemId).Any(y => y == fileName));
        }

Usage Example

Example #1
0
        private bool OverrideStatus(string fileName, HgFileStatus status)
        {
            if (NeedToSearchChildren(fileName, status))
            {
                var project = VisualHgSolution.FindProject(fileName);

                return(HasPendingChildren(project));
            }

            return(false);
        }