TypeAndMemberDropdownBars.OnSynchronizeDropdowns Method
Called to fill and synchronize all combo boxes.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'Declaration
Public MustOverride Function OnSynchronizeDropdowns ( _
languageService As LanguageService, _
textView As IVsTextView, _
line As Integer, _
col As Integer, _
dropDownTypes As ArrayList, _
dropDownMembers As ArrayList, _
ByRef selectedType As Integer, _
ByRef selectedMember As Integer _
) As Boolean
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.
Remarks
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.