IVsContainedLanguageHost.CanReformatCode 方法

确定代码重新设置当前是否允许的。

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

语法

声明
Function CanReformatCode ( _
    <OutAttribute> ByRef pfCanReformat As Integer _
) As Integer
int CanReformatCode(
    out int pfCanReformat
)
int CanReformatCode(
    [OutAttribute] int% pfCanReformat
)
abstract CanReformatCode : 
        pfCanReformat:int byref -> int
function CanReformatCode(
    pfCanReformat : int
) : int

参数

  • pfCanReformat
    类型:Int32%

    [out] 返回非零 (TRUE),如果代码可以重新设置;否则,返回零 (0)FALSE)。

返回值

类型:Int32
如果成功,则返回; S_OK否则,返回错误代码。

备注

COM 签名

从 singlefileeditor.idl:

HRESULT CanReformatCode(
   [out] BOOL* pfCanReformat
);

此方法用于代码语言可能需要重新设置代码中处理的情况,但编辑器正忙在可能会干扰重新设置格式的其他任务。

.NET Framework 安全性

请参阅

参考

IVsContainedLanguageHost 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间