Source::GetMarkerCommandInfo Method (IVsHiddenRegion^, Int32, array<String^>^, array<UInt32>^)

 

Determines which marker commands can be shown on a context menu for the specified hidden region.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
virtual int GetMarkerCommandInfo(
	IVsHiddenRegion^ region,
	int item,
	array<String^>^ outText,
	array<unsigned int>^ flags
)

Parameters

region
Type: Microsoft.VisualStudio.TextManager.Interop::IVsHiddenRegion^

An IVsHiddenRegion object describing the hidden region.

item
Type: System::Int32

A value from the MarkerCommandValues enumeration specifying the command to examine.

outText
Type: array<System::String^>^

[out] Returns the string to show on the context menu if the specified command is supported.

flags
Type: array<System::UInt32>^

[out] Returns a set of flags from the OLECMDF enumeration indicating whether the command is supported.

Return Value

Type: System::Int32

If successful, returns S_OK; otherwise, returns an error code. If support for commands on a hidden region is not needed, return E_NOTIMPL.

When a user right-clicks on a hidden region marker, a context menu is displayed. This method is called for all commands in the MarkerCommandValues enumeration and it is this method that decides whether the command is supported. If a command is supported, the returned string is used as the command name on the context menu and the command is added to the top of the menu. If there are multiple markers at the cursor position, the markers are examined in order of priority until a marker claims support for a command (this means lower priority markers that might support the command are ignored). When the user selects a command from the context menu, ExecMarkerCommand is called to execute the command.

The base method always returns E_NOTIMPL.

Return to top
Show: