private T GetPropertyValue <T>(IVsSolution solutionInterface, __VSPROPID solutionProperty) { object value = null; T result = default(T); if (solutionInterface.GetProperty((int)solutionProperty, out value) == Microsoft.VisualStudio.VSConstants.S_OK) { result = (T)value; } return(result); }
public static T GetProp <T>(this IVsSolution hierarchy, __VSPROPID propid) { object tmp; hierarchy.GetProperty((int)propid, out tmp); if (tmp != null) { return((T)tmp); } return(default(T)); }
private DirectoryInfo GetPropAsDir(__VSPROPID prop) { IVsSolution solution = GetService(typeof(SVsSolution)) as IVsSolution; if (solution != null) { object objSolutionDir; solution.GetProperty((int)prop, out objSolutionDir); if (objSolutionDir != null) { string solutionDir = objSolutionDir.ToString(); return(new DirectoryInfo(solutionDir)); } } return(null); }
public static T GetProperty <T>(this IVsHierarchyItem item, __VSPROPID propId, T defaultValue = default(T)) { return(item.GetProperty <T> ((int)propId, defaultValue)); }
public static T GetProperty <T>(this IVsSolution solution, __VSPROPID propId, T defaultValue = default(T)) { return(solution.GetProperty <T> ((int)propId, defaultValue)); }