TypeAndMemberDropdownBars.OnSynchronizeDropdowns Method (LanguageService, IVsTextView, Int32, Int32, ArrayList, ArrayList, Int32, Int32)

 

Called to fill and synchronize all combo boxes.

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

public abstract bool OnSynchronizeDropdowns(
	LanguageService languageService,
	IVsTextView textView,
	int line,
	int col,
	ArrayList dropDownTypes,
	ArrayList dropDownMembers,
	ref int selectedType,
	ref int selectedMember
)

Parameters

languageService
Type: Microsoft.VisualStudio.Package.LanguageService

[in] A LanguageService object representing the language service that uses the combo boxes.

textView
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextView

[in] An IVsTextView object representing the view the combo boxes are placed in and the view that shows the source file.

line
Type: System.Int32

[in] The line number the caret is currently on.

col
Type: System.Int32

[in] The character offset the caret is currently on.

dropDownTypes
Type: System.Collections.ArrayList

[in, out] An ArrayList of DropDownMembers representing the types combo box.

dropDownMembers
Type: System.Collections.ArrayList

[in, out] An ArrayList of DropDownMembers representing the members combo box.

selectedType
Type: System.Int32

[in, out] The index of the entry to be selected in the types combo box. This can also be set if the current selection is invalid.

selectedMember
Type: System.Int32

[in, out] The index of the entry to be selected in the members combo box. This can also be set if the current selection is invalid.

Return Value

Type: System.Boolean

If successful, returns true if the combo boxes have been changed; otherwise returns false.

This method must be implemented in a class derived from the TypeAndMemberDropdownBars class.

This method does whatever is necessary to populate the two lists supplied in the dropDownTypes and dropDownMembers parameters. How this is done is entirely up to you. One possible approach is to implement a custom method on the Source class to return a list filled with all methods, their location and their containing types obtained from the last full parse. A second custom method on the Source class could return a list of all types (classes and structures) obtained from the last full parse. These two lists could be added to a derived version of the AuthoringSink class which is used to gather information during a parsing operation.

Then, to implement the OnSynchronizeDropdowns method, you would obtain the Source object from the LanguageService object by calling the GetSource method with the IVsTextView object. Call your two custom methods on the Source object to obtain the lists of types and members and use those lists to create the DropDownMember objects for the dropDownTypes and dropDownMembers lists.

Return to top
Show: