Udostępnij za pośrednictwem


IVsHiddenRegion.GetBehavior(UInt32) Method

Definition

Returns the hidden region behavior, that is, client-controlled or editor-controlled.

public:
 int GetBehavior([Runtime::InteropServices::Out] System::UInt32 % pdwBehavior);
int GetBehavior([Runtime::InteropServices::Out] unsigned int & pdwBehavior);
public int GetBehavior (out uint pdwBehavior);
abstract member GetBehavior : uint32 -> int
Public Function GetBehavior (ByRef pdwBehavior As UInteger) As Integer

Parameters

pdwBehavior
UInt32

[out] Pointer to the hidden region behavior. For more information, see HIDDEN_REGION_BEHAVIOR.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsHiddenRegion::GetBehavior(  
   [out] DWORD *pdwBehavior  
);  

The behavior is a permanent property of the hidden region. The hidden region behavior determines whether the region is controlled by the client or by the editor. Here are the key features that you can explicitly control if you use client controlled (hrbClientControlled) or editor controlled (hrbEditorControlled) behavior for your hidden region, along with each option's default implementation:

  • Banner text

    • hrbClientControlled: the banner text option is specified using NewHiddenRegion and SetBanner.

    • hrbEditorControlled: the banner text is always a fixed string, which is "..." by default

  • Tip text

    • hrbClientControlled: Tip text is specified using M:Microsoft.VisualStudio.TextManager.Interop.IVsHiddenTextClient.GetTipText(Microsoft.VisualStudio.TextManager.Interop.IVsHiddenRegion,System.String[]) .

    • hrbEditorControlled: the first N non-white space characters of the hidden text are truncated for presentation.

  • Command negotiation

    • hrbClientControlled: Context menu commands are exposed and handled using the GetMarkerCommandInfo method or the ExecMarkerCommand method.

    • hrbEditorControlled: Context menu commands are fixed. For example, Hide Selection and Stop Outlining.

  • Event notification

    • hrbClientControlled: Notification is provided using the IVsHiddenTextClient interface, about when the hidden region is deleted, its state changes, and so on.

    • hrbEditorControlled: No notification is sent to the client. The editor handles all notification internally.

If you want to do simple outlining, use hrbEditorControlled. If you want more detailed control over how the hidden regions behave, use hrbClientControlled.

Applies to