共用方式為


IVsHiddenRegion.GetBehavior Method

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

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

Syntax

'宣告
Function GetBehavior ( _
    <OutAttribute> ByRef pdwBehavior As UInteger _
) As Integer
int GetBehavior(
    out uint pdwBehavior
)
int GetBehavior(
    [OutAttribute] unsigned int% pdwBehavior
)
abstract GetBehavior : 
        pdwBehavior:uint32 byref -> int 
function GetBehavior(
    pdwBehavior : uint
) : int

Parameters

Return Value

Type: System.Int32
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.

.NET Framework Security

See Also

Reference

IVsHiddenRegion Interface

Microsoft.VisualStudio.TextManager.Interop Namespace