/// <summary> /// Override GetProperty so we can support linked files. /// </summary> /// <param name="propId"></param> /// <returns></returns> public override object GetProperty(int propId) { switch ((__VSHPROPID)propId) { case __VSHPROPID.VSHPROPID_OverlayIconIndex: { // Valid range of Overlay State Icon (see vsshell.idl): // OVERLAYICON_NONE = 0, // OVERLAYICON_SHORTCUT = 1, // OVERLAYICON_POLICY = 2, // OVERLAYICON_CONNECTED = 3, // OVERLAYICON_DISCONNECTED = 4, // OVERLAYICON_MAXINDEX = 4 //should be same as last valid overlay if (this.IsLinkFile) { return(VSOVERLAYICON.OVERLAYICON_SHORTCUT); } return(VSOVERLAYICON.OVERLAYICON_NONE); } } __VSHPROPID2 id2 = (__VSHPROPID2)propId; switch (id2) { case __VSHPROPID2.VSHPROPID_IsLinkFile: { if (this.IsLinkFile) { return(true); } return(false); } } return(base.GetProperty(propId)); }
public static T GetProp <T>(this IVsHierarchy hierarchy, uint currentItem, __VSHPROPID2 prop) { return(GetProp <T>(hierarchy, currentItem, (int)prop)); }
public object GetProperty(__VSHPROPID2 vsPropID) { object objOut = null; m_vsHierarchy.GetProperty((uint)m_vsItemID, (int)vsPropID, out objOut); return objOut; }
//-------------------------------------------------------------------------------------------- /// <summary> /// Get the specified property from the __VSHPROPID2 enumeration for this item /// </summary> //-------------------------------------------------------------------------------------------- private object GetPropHelper(__VSHPROPID2 propid) { return(GetPropHelper(_vsitemid, (int)propid)); }
private static bool TryGetItemProperty(IVsHierarchy hierarchy, uint itemId, __VSHPROPID2 property, out object value) { return(ErrorHandler.Succeeded(hierarchy.GetProperty(itemId, (int)property, out value))); }
private static bool TryGetItemProperty(IVsHierarchy hierarchy, uint itemId, __VSHPROPID2 property, out object value) { return ErrorHandler.Succeeded(hierarchy.GetProperty(itemId, (int)property, out value)); }