static public string GetUniqueUIName(IVsProject project)
        {
            IVsSolution3 solution = _serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution3;
            string       name     = null;
            int          hr       = solution.GetUniqueUINameOfProject((IVsHierarchy)project, out name);

            System.Diagnostics.Debug.Assert(hr == VSConstants.S_OK, "GetUniqueUINameOfProject failed.");
            return(name);
        }
Exemple #2
0
        /// <summary>
        /// Called by MyProjectTracker to get the name of the event's project.
        /// If project==null then gets the Solution name.
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        public string GetProjectName(IVsProject project)
        {
            if (project == null)
            {
                return(Resources.RootSolution); // GetSolutionName();
            }

            IVsSolution3 solution    = Solution as IVsSolution3;
            string       projectName = null;

            ErrorHandler.ThrowOnFailure(solution.GetUniqueUINameOfProject((IVsHierarchy)project, out projectName));
            return(projectName);
        }
 public int GetUniqueUINameOfProject(IVsHierarchy pHierarchy, out string pbstrUniqueName)
 {
     return(_solution.GetUniqueUINameOfProject(pHierarchy, out pbstrUniqueName));
 }