SPUtility.MapToIcon Method (SPWeb, String, String, IconSize)
Returns the name of the image file for the icon that is used to represent the specified file.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function MapToIcon ( _
web As SPWeb, _
strFileName As String, _
strProgID As String, _
size As IconSize _
) As String
'Usage
Dim web As SPWeb
Dim strFileName As String
Dim strProgID As String
Dim size As IconSize
Dim returnValue As String
returnValue = SPUtility.MapToIcon(web, _
strFileName, strProgID, size)
public static string MapToIcon(
SPWeb web,
string strFileName,
string strProgID,
IconSize size
)
Parameters
web
Type: Microsoft.SharePoint.SPWebAn SPWeb object that represents the site containing the file.
strFileName
Type: System.StringA string that contains the file name.
strProgID
Type: System.StringA string that contains the program ID (ProgID) of the application that was used to create the file.
size
Type: Microsoft.SharePoint.Utilities.IconSizeAn IconSize object that specifies the default icon size. This determines if the icon is either 16x16 or 32x32 pixels.
Return Value
Type: System.String
A string that contains the name of the icon image file.