LanguageService.IVsFormatFilterProvider.CurFileExtensionFormat Method
Returns the index into the file extension list that matches the extension of the specified file name.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'宣告
Private Function CurFileExtensionFormat ( _
bstrFileName As String, _
<OutAttribute> ByRef pdwExtnIndex As UInteger _
) As Integer Implements IVsFormatFilterProvider.CurFileExtensionFormat
int IVsFormatFilterProvider.CurFileExtensionFormat(
string bstrFileName,
out uint pdwExtnIndex
)
Parameters
- bstrFileName
Type: System.String
[in] The file name from which to get the extension to look for.
- pdwExtnIndex
Type: System.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").
Return Value
Type: System.Int32
If successful, returns S_OK; otherwise, returns an error code.
Implements
IVsFormatFilterProvider.CurFileExtensionFormat(String, UInt32%)
Remarks
This is used to select the appropriate filter when showing a Save As dialog box to save a file.
The base method calls LanguageService.CurFileExtensionFormat to determine the index. Note that the base method translates a -1 return value to a 0 index.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.