Share via


AuthoringSink.AddHiddenRegion Method

Definition

Add a hidden region to the internal list.

Overloads

AddHiddenRegion(NewHiddenRegion)

AddHiddenRegion calls this for you, you can call it directly or override it to modify the default behavior.

AddHiddenRegion(TextSpan)

This is in support of outlining.

AddHiddenRegion(TextSpan, String)

Add a hidden region to the internal list.

Remarks

A hidden region is a span of code that can be removed from view. This is typically used in outlining where sections of code can be hidden or exposed by the user in order to reduce clutter in the editor window. Another example of hidden regions is the #region/#endregion keywords in C# that bracket any arbitrary section of code which allows the user to hide uninteresting code from view.

AddHiddenRegion(NewHiddenRegion)

AddHiddenRegion calls this for you, you can call it directly or override it to modify the default behavior.

public:
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::NewHiddenRegion r);
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::NewHiddenRegion r);
public virtual void AddHiddenRegion (Microsoft.VisualStudio.TextManager.Interop.NewHiddenRegion r);
abstract member AddHiddenRegion : Microsoft.VisualStudio.TextManager.Interop.NewHiddenRegion -> unit
override this.AddHiddenRegion : Microsoft.VisualStudio.TextManager.Interop.NewHiddenRegion -> unit
Public Overridable Sub AddHiddenRegion (r As NewHiddenRegion)

Parameters

r
NewHiddenRegion

[in] A NewHiddenRegion object to add to the list.

Remarks

A NewHiddenRegion contains a number of flags as well as a TextSpan describing the region to be hidden.

The base method adds the specified region to an internal list. Note that there is no checking for duplicate regions so it is possible to add the same region twice.

Applies to

AddHiddenRegion(TextSpan)

This is in support of outlining.

public:
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::TextSpan context);
public:
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::TextSpan context);
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::TextSpan context);
public virtual void AddHiddenRegion (Microsoft.VisualStudio.TextManager.Interop.TextSpan context);
abstract member AddHiddenRegion : Microsoft.VisualStudio.TextManager.Interop.TextSpan -> unit
override this.AddHiddenRegion : Microsoft.VisualStudio.TextManager.Interop.TextSpan -> unit
Public Overridable Sub AddHiddenRegion (context As TextSpan)

Parameters

context
TextSpan

[in] A TextSpan object describing the span of code to be hidden.

Remarks

The base method constructs a NewHiddenRegion object that contains the given TextSpan object and calls the other AddHiddenRegion method.

The new NewHiddenRegion object has the following attributes set:

Attribute Value
Type hrtCollapsible (from the HIDDEN_REGION_TYPE enumeration)
Behavior hrbEditorControlled (from the HIDDEN_REGION_BEHAVIOR enumeration)
State hrsExpanded (from the HIDDEN_REGION_STATE enumeration)
Banner null

Applies to

AddHiddenRegion(TextSpan, String)

Add a hidden region to the internal list.

public:
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::TextSpan context, System::String ^ banner);
public:
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::TextSpan context, Platform::String ^ banner);
 virtual void AddHiddenRegion(Microsoft::VisualStudio::TextManager::Interop::TextSpan context, std::wstring const & banner);
public virtual void AddHiddenRegion (Microsoft.VisualStudio.TextManager.Interop.TextSpan context, string banner);
abstract member AddHiddenRegion : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string -> unit
override this.AddHiddenRegion : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string -> unit
Public Overridable Sub AddHiddenRegion (context As TextSpan, banner As String)

Parameters

context
TextSpan

The text span to which to add the region

banner
String

The banner.

Applies to