Partager via


CompletionSet.GetDisplayText(Int32, String, Int32[]) Method

Definition

Gets the text and image index to display in the completion list for the specified item.

public:
 virtual int GetDisplayText(int index, [Runtime::InteropServices::Out] System::String ^ % text, cli::array <int> ^ glyph);
int GetDisplayText(int index, [Runtime::InteropServices::Out] std::wstring const & & text, std::Array <int> const & glyph);
public int GetDisplayText (int index, out string text, int[] glyph);
abstract member GetDisplayText : int * string * int[] -> int
override this.GetDisplayText : int * string * int[] -> int
Public Function GetDisplayText (index As Integer, ByRef text As String, glyph As Integer()) As Integer

Parameters

index
Int32

[in] The index of the item for which to get the display text and image.

text
String

[out] Returns the display text, or null if there is no display text.

glyph
Int32[]

[in, out] Returns the index of the image to display, or -1 if no image is to be displayed. This parameter can be null, indicating the caller does not want the image index.

Returns

If successful, returns S_OK; otherwise, returns an error code.

Implements

Remarks

The display text is what is shown in the completion list. The glyph or image is an icon that is typically displayed to the left of the display text and should indicate what type the display text represents. For example, the display text might represent a method, a class variable, a property, or an event handler. In each case a different image would be shown.

This method is an implementation of the GetDisplayText method on the IVsCompletionSet interface.

To retrieve the display text, the base method calls the GetDisplayText method on the Declarations object that was passed to the Init method. The base method also calls the GetGlyph method on the Declarations object if the glyph parameter is not null. The base method always returns a success code of S_OK.

Applies to