Partilhar via


TypeAndMemberDropdownBars Class

Definition

Important

This API is not CLS-compliant.

Represents the two drop down bars on the top of a text editor window that allow types and type members to be selected by name.

public ref class TypeAndMemberDropdownBars abstract : Microsoft::VisualStudio::TextManager::Interop::IVsDropdownBarClient
[Windows::Foundation::Metadata::WebHostHidden]
public ref class TypeAndMemberDropdownBars abstract : Microsoft::VisualStudio::TextManager::Interop::IVsDropdownBarClient
[Windows::Foundation::Metadata::WebHostHidden]
class TypeAndMemberDropdownBars abstract : Microsoft::VisualStudio::TextManager::Interop::IVsDropdownBarClient
[System.CLSCompliant(false)]
public abstract class TypeAndMemberDropdownBars : Microsoft.VisualStudio.TextManager.Interop.IVsDropdownBarClient
public abstract class TypeAndMemberDropdownBars : Microsoft.VisualStudio.TextManager.Interop.IVsDropdownBarClient
[<System.CLSCompliant(false)>]
type TypeAndMemberDropdownBars = class
    interface IVsDropdownBarClient
type TypeAndMemberDropdownBars = class
    interface IVsDropdownBarClient
Public MustInherit Class TypeAndMemberDropdownBars
Implements IVsDropdownBarClient
Inheritance
TypeAndMemberDropdownBars
Attributes
Implements

Remarks

This class is used to manage the combo boxes showing type and member information for a particular source file. These combo boxes appear in a drop-down bar (represented by an IVsDropdownBar interface) at the top of the editor view showing the source file. This class contains all the information required for Visual Studio to show and manage those combo boxes. In addition, this class contains event handlers that are called when the combo boxes are accessed by the user.

SynchronizeDropdowns

SynchronizeDropdowns is a method that is marked as internal and is called from the base CodeWindowManager class. This internal method is given an IVsTextView object when the base AddAdornments method on the CodeWindowManager class is called. The IVsTextView object is used to update the display when an item is chosen in a combo box. The SynchronizeDropdowns method is also called from the base method SynchronizeDropdowns in the LanguageService class.

Notes to Implementers

If you plan to support the type and member combo boxes, you must derive a class from the TypeAndMemberDropdownBars class and return an instance of your class from the CreateDropDownHelper(IVsTextView) method in your version of the LanguageService class. In addition, you must implement the OnSynchronizeDropdowns(LanguageService, IVsTextView, Int32, Int32, ArrayList, ArrayList, Int32, Int32) method which handles the task of filling the internal lists to be shown in the combo boxes.

Notes to Callers

An instance of your version of a TypeAndMemberDropdownBars object is returned from a call to CreateDropDownHelper(IVsTextView) in the LanguageService class. If CreateDropDownHelper(IVsTextView) returns a valid object, Visual Studio creates and manages the combo boxes for you, using information from your version of the TypeAndMemberDropdownBars class.

Constructors

TypeAndMemberDropdownBars(LanguageService)

Initializes a new instance of the TypeAndMemberDropdownBars class.

Methods

Done()

Cleans up any allocated resources just before the TypeAndMemberDropdownBars object is destroyed.

GetComboAttributes(Int32, UInt32, UInt32, IntPtr)

Returns information about the specified combo box.

GetComboTipText(Int32, String)

Returns text to be shown in a tool tip when the cursor is held over the combo box.

GetEntryAttributes(Int32, Int32, UInt32)

Returns the font attributes for the specified entry on the specified combo box.

GetEntryImage(Int32, Int32, Int32)

Returns the glyph index for the specified entry on the specified combo box.

GetEntryText(Int32, Int32, String)

Returns the text to be displayed for the specified entry in the specified combo box.

GetMember(Int32, Int32)

Returns the specified entry for the specified combo box.

OnComboGetFocus(Int32)

Called when a combo box gets the focus.

OnItemChosen(Int32, Int32)

Called when an item is chosen from the specified combo box.

OnItemSelected(Int32, Int32)

Called when an entry is highlighted in one of the combo boxes.

OnSynchronizeDropdowns(LanguageService, IVsTextView, Int32, Int32, ArrayList, ArrayList, Int32, Int32)

This method is called to update the drop down bars to match the current contents of the text editor window. It is called during OnIdle when the caret position changes. You can provide new drop down members here. It is up to you to sort the ArrayLists if you want them sorted in any particular order.

SetDropdownBar(IVsDropdownBar)

Called to specify the IVsDropdownBar object that controls the two combo boxes.

Applies to