Condividi tramite


TypeAndMemberDropdownBars.OnSynchronizeDropdowns Method

Called to fill and synchronize all combo boxes.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

'Dichiarazione
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
'Utilizzo
Dim instance As TypeAndMemberDropdownBars
Dim languageService As LanguageService
Dim textView As IVsTextView
Dim line As Integer
Dim col As Integer
Dim dropDownTypes As ArrayList
Dim dropDownMembers As ArrayList
Dim selectedType As Integer
Dim selectedMember As Integer
Dim returnValue As Boolean

returnValue = instance.OnSynchronizeDropdowns(languageService, _
    textView, line, col, dropDownTypes, _
    dropDownMembers, selectedType, selectedMember)
public abstract bool OnSynchronizeDropdowns(
    LanguageService languageService,
    IVsTextView textView,
    int line,
    int col,
    ArrayList dropDownTypes,
    ArrayList dropDownMembers,
    ref int selectedType,
    ref int selectedMember
)
public:
virtual bool OnSynchronizeDropdowns(
    LanguageService^ languageService, 
    IVsTextView^ textView, 
    int line, 
    int col, 
    ArrayList^ dropDownTypes, 
    ArrayList^ dropDownMembers, 
    int% selectedType, 
    int% selectedMember
) abstract
abstract OnSynchronizeDropdowns : 
        languageService:LanguageService * 
        textView:IVsTextView * 
        line:int * 
        col:int * 
        dropDownTypes:ArrayList * 
        dropDownMembers:ArrayList * 
        selectedType:int byref * 
        selectedMember:int byref -> bool 
public abstract function OnSynchronizeDropdowns(
    languageService : LanguageService, 
    textView : IVsTextView, 
    line : int, 
    col : int, 
    dropDownTypes : ArrayList, 
    dropDownMembers : ArrayList, 
    selectedType : int, 
    selectedMember : int
) : boolean

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

TypeAndMemberDropdownBars Members

Microsoft.VisualStudio.Package Namespace