IVsContainedLanguageHost::CanReformatCode Method (Int32)

 

Determines if code reformatting is currently allowed.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

int CanReformatCode(
	[OutAttribute] int% pfCanReformat
)

Parameters

pfCanReformat
Type: System::Int32

[out] Returns nonzero (TRUE) if the code can be reformatted; otherwise, returns zero (FALSE).

Return Value

Type: System::Int32

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

From singlefileeditor.idl:

HRESULT CanReformatCode(
   [out] BOOL* pfCanReformat
);

This method is used to handle situations where the code language may want to reformat the code but the editor is still busy on other tasks that could interfere with the reformatting.

Return to top
Show: