Freigeben über


Source.GetMarkerCommandInfo Method

Definition

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

public:
 virtual int GetMarkerCommandInfo(Microsoft::VisualStudio::TextManager::Interop::IVsHiddenRegion ^ region, int item, cli::array <System::String ^> ^ outText, cli::array <System::UInt32> ^ flags);
public:
 virtual int GetMarkerCommandInfo(Microsoft::VisualStudio::TextManager::Interop::IVsHiddenRegion ^ region, int item, Platform::Array <Platform::String ^> ^ outText, Platform::Array <unsigned int> ^ flags);
 virtual int GetMarkerCommandInfo(Microsoft::VisualStudio::TextManager::Interop::IVsHiddenRegion const & region, int item, std::Array <std::wstring const &> const & outText, std::Array <unsigned int> const & flags);
public virtual int GetMarkerCommandInfo (Microsoft.VisualStudio.TextManager.Interop.IVsHiddenRegion region, int item, string[] outText, uint[] flags);
abstract member GetMarkerCommandInfo : Microsoft.VisualStudio.TextManager.Interop.IVsHiddenRegion * int * string[] * uint32[] -> int
override this.GetMarkerCommandInfo : Microsoft.VisualStudio.TextManager.Interop.IVsHiddenRegion * int * string[] * uint32[] -> int
Public Overridable Function GetMarkerCommandInfo (region As IVsHiddenRegion, item As Integer, outText As String(), flags As UInteger()) As Integer

Parameters

region
IVsHiddenRegion

An IVsHiddenRegion object describing the hidden region.

item
Int32

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

outText
String[]

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

flags
UInt32[]

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

Returns

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

Implements

Remarks

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.

Applies to