private void removeIceBuilder_BeforeQueryStatus(object sender, EventArgs e) { try { OleMenuCommand command = sender as OleMenuCommand; if (command != null) { IVsProject p = DTEUtil.GetSelectedProject(); if (p != null) { if (DTEUtil.IsCppProject(p) || DTEUtil.IsCSharpProject(p)) { command.Enabled = MSBuildUtils.IsIceBuilderEnabled(MSBuildUtils.LoadedProject(ProjectUtil.GetProjectFullPath(p), DTEUtil.IsCppProject(p), true)); } else { command.Enabled = false; } } } } catch (Exception ex) { Package.UnexpectedExceptionWarning(ex); throw; } }
public static IceBuilderProjectType IsIceBuilderEnabled(IVsProject project) { if (project != null) { IceBuilderProjectType type = IsCppProject(project) ? IceBuilderProjectType.CppProjectType : IsCSharpProject(project) ? IceBuilderProjectType.CsharpProjectType : IceBuilderProjectType.None; if (type != IceBuilderProjectType.None) { if (MSBuildUtils.IsIceBuilderEnabled(project.GetMSBuildProject(true))) { return(type); } } } return(IceBuilderProjectType.None); }
public static IceBuilderProjectType IsIceBuilderEnabled(IVsProject project) { if (project != null) { IceBuilderProjectType type = IsCppProject(project) ? IceBuilderProjectType.CppProjectType : IsCSharpProject(project) ? IceBuilderProjectType.CsharpProjectType : IceBuilderProjectType.None; if (type != IceBuilderProjectType.None) { if (MSBuildUtils.IsIceBuilderEnabled(MSBuildUtils.LoadedProject(ProjectUtil.GetProjectFullPath(project), DTEUtil.IsCppProject(project), true))) { return(type); } } } return(IceBuilderProjectType.None); }
// // Check if IceBuilder 4.x is enabled // public static IceBuilderProjectType IsIceBuilderEnabled(IVsProject project) { if (project != null) { IceBuilderProjectType type = project.IsCppProject() ? IceBuilderProjectType.CppProjectType : project.IsCSharpProject() ? IceBuilderProjectType.CsharpProjectType : IceBuilderProjectType.None; if (type != IceBuilderProjectType.None) { return(project.WithProject((MSProject msproject) => { if (MSBuildUtils.IsIceBuilderEnabled(msproject)) { return type; } return IceBuilderProjectType.None; })); } } return(IceBuilderProjectType.None); }