다음을 통해 공유


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

‘선언
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

  • 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.
  • 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

See Also

Reference

TypeAndMemberDropdownBars Class

Microsoft.VisualStudio.Package Namespace