/// <summary> /// Sets the value. /// </summary> /// <param name="currentValue">The current value.</param> /// <param name="newValue">The new value.</param> /// <returns></returns> private bool SetValue(object currentValue, out object newValue) { if (currentValue == null) { DTE dte = (DTE)GetService(typeof(DTE)); newValue = DteHelperEx.GetCodeDomProvider(DteHelper.GetSelectedProject(dte)); return(true); } newValue = null; return(false); }
/// <summary> /// Gets the language from project. /// </summary> /// <param name="project">The project.</param> /// <returns></returns> public static string GetLanguageFromProject(EnvDTE.Project project) { if (project != null) { if (project.CodeModel != null) { return(project.CodeModel.Language); } CodeDomProvider provider = DteHelperEx.GetCodeDomProvider(project); if (provider is CSharp.CSharpCodeProvider) { return(EnvDTE.CodeModelLanguageConstants.vsCMLanguageCSharp); } else if (provider is VisualBasic.VBCodeProvider) { return(EnvDTE.CodeModelLanguageConstants.vsCMLanguageVB); } } return(null); }