IVsFormatFilterProvider.CurFileExtensionFormat 方法

提供在筛选器的索引列表文件扩展名通过匹配。

命名空间:  Microsoft.VisualStudio.TextManager.Interop
程序集:  Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

语法

声明
Function CurFileExtensionFormat ( _
    bstrFileName As String, _
    <OutAttribute> ByRef pdwExtnIndex As UInteger _
) As Integer
int CurFileExtensionFormat(
    string bstrFileName,
    out uint pdwExtnIndex
)
int CurFileExtensionFormat(
    [InAttribute] String^ bstrFileName, 
    [OutAttribute] unsigned int% pdwExtnIndex
)
abstract CurFileExtensionFormat : 
        bstrFileName:string * 
        pdwExtnIndex:uint32 byref -> int
function CurFileExtensionFormat(
    bstrFileName : String, 
    pdwExtnIndex : uint
) : int

参数

  • bstrFileName
    类型:String

    [in] 文件名和扩展名相关。

  • pdwExtnIndex
    类型:UInt32%

    [out] 在 FormatFilterList ( GetFormatFilterList的 pbstrFilterList 参数的索引)。

返回值

类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 textmgr.idl:

HRESULT IVsFormatFilterProvider::CurFileExtensionFormat(
   [in]BSTR bstrFileName,
   [out] DWORD *pdwExtnIndex
);

在 pdwExtnIndex 返回的索引取决于 FormatFilterList 的位置,它是筛选器 GetFormatFilterList 的 pbstrFilterList 参数匹配的文件扩展名在bstrFileName的。 例如,因此,如果 “。*”在 pdwExtnIndex传递到默认筛选器 (请参见 GetFormatFilterList), 0 将存储。 同样 1”将存储传递的 “.txt。 应只关心到文件扩展名而不是 所有文件文本文件。 如果在 bstrFileName 的文件扩展名与您支持的一,则返回 E_FAIL

.NET Framework 安全性

请参阅

参考

IVsFormatFilterProvider 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间