Partager via


IFileExtensionRegistryService.GetContentTypeForExtension Method

Gets the content type associated with the given file extension.

Namespace:  Microsoft.VisualStudio.Utilities
Assembly:  Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)

Syntax

'Déclaration
Function GetContentTypeForExtension ( _
    extension As String _
) As IContentType
IContentType GetContentTypeForExtension(
    string extension
)
IContentType^ GetContentTypeForExtension(
    String^ extension
)
abstract GetContentTypeForExtension : 
        extension:string -> IContentType 
function GetContentTypeForExtension(
    extension : String
) : IContentType

Parameters

  • extension
    Type: System.String
    The file extension. It cannot be nulla null reference (Nothing in Visual Basic), and it should not contain a period.

Return Value

Type: Microsoft.VisualStudio.Utilities.IContentType
The IContentType associated with this extension. If no association exists, it returns the "unknown" content type. It never returns null.

.NET Framework Security

See Also

Reference

IFileExtensionRegistryService Interface

Microsoft.VisualStudio.Utilities Namespace