Example #1
0
        /// <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));
        }
Example #2
0
 public static T GetProp <T>(this IVsHierarchy hierarchy, uint currentItem, __VSHPROPID2 prop)
 {
     return(GetProp <T>(hierarchy, currentItem, (int)prop));
 }
Example #3
0
 public object GetProperty(__VSHPROPID2 vsPropID)
 {
     object objOut = null;
     m_vsHierarchy.GetProperty((uint)m_vsItemID, (int)vsPropID, out objOut);
     return objOut;
 }
Example #4
0
 //--------------------------------------------------------------------------------------------
 /// <summary>
 /// Get the specified property from the __VSHPROPID2 enumeration for this item
 /// </summary>
 //--------------------------------------------------------------------------------------------
 private object GetPropHelper(__VSHPROPID2 propid)
 {
     return(GetPropHelper(_vsitemid, (int)propid));
 }
Example #5
0
 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));
 }