LanguageService.IVsFormatFilterProvider.CurFileExtensionFormat Method

Definition

Returns the index into the file extension list that matches the extension of the specified file name.

 virtual int Microsoft.VisualStudio.TextManager.Interop.IVsFormatFilterProvider.CurFileExtensionFormat(System::String ^ bstrFileName, [Runtime::InteropServices::Out] System::UInt32 % pdwExtnIndex) = Microsoft::VisualStudio::TextManager::Interop::IVsFormatFilterProvider::CurFileExtensionFormat;
int Microsoft.VisualStudio.TextManager.Interop.IVsFormatFilterProvider.CurFileExtensionFormat(std::wstring const & bstrFileName, [Runtime::InteropServices::Out] unsigned int & pdwExtnIndex);
int IVsFormatFilterProvider.CurFileExtensionFormat (string bstrFileName, out uint pdwExtnIndex);
abstract member Microsoft.VisualStudio.TextManager.Interop.IVsFormatFilterProvider.CurFileExtensionFormat : string * uint32 -> int
override this.Microsoft.VisualStudio.TextManager.Interop.IVsFormatFilterProvider.CurFileExtensionFormat : string * uint32 -> int
Function CurFileExtensionFormat (bstrFileName As String, ByRef pdwExtnIndex As UInteger) As Integer Implements IVsFormatFilterProvider.CurFileExtensionFormat

Parameters

bstrFileName
String

[in] The file name from which to get the extension to look for.

pdwExtnIndex
UInt32

[out] Returns the index into the extension list that references the extension on the given file name. Returns 0 if the extension is not in the list (0 represents "All files").

Returns

If successful, returns S_OK; otherwise, returns an error code.

Implements

Remarks

This is used to select the appropriate filter when showing a Save As dialog box to save a file.

The base method calls Microsoft.VisualStudio.Package.LanguageService.CurFileExtensionFormat to determine the index. Note that the base method translates a -1 return value to a 0 index.

Applies to