Share via


IVsImageService.GetIconForFile Method

Gets the 16x16 icon for the specified file.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)

Syntax

'Declaration
Function GetIconForFile ( _
    filename As String, _
    desiredFormat As __VSUIDATAFORMAT _
) As IVsUIObject
IVsUIObject GetIconForFile(
    string filename,
    __VSUIDATAFORMAT desiredFormat
)
IVsUIObject^ GetIconForFile(
    [InAttribute] String^ filename, 
    [InAttribute] __VSUIDATAFORMAT desiredFormat
)
abstract GetIconForFile : 
        filename:string * 
        desiredFormat:__VSUIDATAFORMAT -> IVsUIObject
function GetIconForFile(
    filename : String, 
    desiredFormat : __VSUIDATAFORMAT
) : IVsUIObject

Parameters

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsUIObject
The icon object. Returns null if the icon cannot be retrieved.

.NET Framework Security

See Also

Reference

IVsImageService Interface

Microsoft.VisualStudio.Shell.Interop Namespace