protected override int GetProperty(uint itemId, int propId, out object property)
        {
            switch ((__VSHPROPID2)propId)
            {
            case __VSHPROPID2.VSHPROPID_CfgPropertyPagesCLSIDList: {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => CfgSpecificPropertyPagesToRemove.Contains(g));
                    guids.AddRange(CfgSpecificPropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }

            case __VSHPROPID2.VSHPROPID_PropertyPagesCLSIDList: {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => PropertyPagesToRemove.Contains(g));
                    guids.AddRange(PropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }
            }

            return(base.GetProperty(itemId, propId, out property));
        }
        protected override int GetProperty(uint itemId, int propId, out object property)
        {
#if HAVE_ICONS
            switch ((__VSHPROPID)propId)
            {
            case __VSHPROPID.VSHPROPID_IconIndex:
                // replace the default icon w/ our own icon for HTML files.
                // We can't return an index into an image list that we own because
                // the image list is owned by the root node.  So we just fail this
                // call for HTML files, which causes a request for VSHPROPID_IconHandle
                // where we give the actual icon.
                if (IsHtmlFile(innerVsHierarchy, itemId))
                {
                    property = 26;
                    return(VSConstants.DISP_E_MEMBERNOTFOUND);
                }
                break;

            case __VSHPROPID.VSHPROPID_IconHandle:
                if (IsHtmlFile(innerVsHierarchy, itemId))
                {
                    property = (Images.Images[26] as Bitmap).GetHicon();
                    return(VSConstants.S_OK);
                }
                break;
            }
#endif
            switch ((__VSHPROPID2)propId)
            {
            case __VSHPROPID2.VSHPROPID_CfgPropertyPagesCLSIDList: {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => CfgSpecificPropertyPagesToRemove.Contains(g));
                    guids.AddRange(CfgSpecificPropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }

            case __VSHPROPID2.VSHPROPID_PropertyPagesCLSIDList: {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => PropertyPagesToRemove.Contains(g));
                    guids.AddRange(PropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }
            }

            return(base.GetProperty(itemId, propId, out property));
        }
Beispiel #3
0
        protected override int GetProperty(uint itemId, int propId, out object property)
        {
            switch ((__VSHPROPID2)propId)
            {
            case __VSHPROPID2.VSHPROPID_CfgPropertyPagesCLSIDList:
            {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => CfgSpecificPropertyPagesToRemove.Contains(g));
                    guids.AddRange(CfgSpecificPropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }

            case __VSHPROPID2.VSHPROPID_PropertyPagesCLSIDList:
            {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => PropertyPagesToRemove.Contains(g));
                    guids.AddRange(PropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }
            }

            switch ((__VSHPROPID6)propId)
            {
            case __VSHPROPID6.VSHPROPID_Subcaption:
            {
                var    bps        = this._innerProject as IVsBuildPropertyStorage;
                string descriptor = null;

                if (bps != null)
                {
                    var res = bps.GetPropertyValue("TargetOsAndVersion", null, (uint)_PersistStorageType.PST_PROJECT_FILE, out descriptor);
                    property = descriptor;
                    return(res);
                }
                break;
            }
            }

            return(base.GetProperty(itemId, propId, out property));
        }
Beispiel #4
0
        protected override int GetProperty(uint itemId, int propId, out object property)
        {
            switch ((__VSHPROPID2)propId)
            {
            case __VSHPROPID2.VSHPROPID_CfgPropertyPagesCLSIDList: {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => CfgSpecificPropertyPagesToRemove.Contains(g));
                    guids.AddRange(CfgSpecificPropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }

            case __VSHPROPID2.VSHPROPID_PropertyPagesCLSIDList: {
                var res = base.GetProperty(itemId, propId, out property);
                if (ErrorHandler.Succeeded(res))
                {
                    var guids = GetGuidsFromList(property as string);
                    guids.RemoveAll(g => PropertyPagesToRemove.Contains(g));
                    guids.AddRange(PropertyPagesToAdd);
                    property = MakeListFromGuids(guids);
                }
                return(res);
            }
            }

#if DEV14_OR_LATER
            var id8 = (__VSHPROPID8)propId;
            switch (id8)
            {
            case __VSHPROPID8.VSHPROPID_SupportsIconMonikers:
                property = true;
                return(VSConstants.S_OK);
            }
#endif

            return(base.GetProperty(itemId, propId, out property));
        }