共用方式為


CompletionSet.Init Method

Initializes the completion set object.

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

Syntax

'宣告
Public Overridable Sub Init ( _
    textView As IVsTextView, _
    declarations As Declarations, _
    completeWord As Boolean _
)
'用途
Dim instance As CompletionSet
Dim textView As IVsTextView
Dim declarations As Declarations
Dim completeWord As Boolean

instance.Init(textView, declarations, _
    completeWord)
public virtual void Init(
    IVsTextView textView,
    Declarations declarations,
    bool completeWord
)
public:
virtual void Init(
    IVsTextView^ textView, 
    Declarations^ declarations, 
    bool completeWord
)
abstract Init : 
        textView:IVsTextView * 
        declarations:Declarations * 
        completeWord:bool -> unit 
override Init : 
        textView:IVsTextView * 
        declarations:Declarations * 
        completeWord:bool -> unit 
public function Init(
    textView : IVsTextView, 
    declarations : Declarations, 
    completeWord : boolean
)

Parameters

  • completeWord
    Type: System.Boolean
    [in] true if part of a word is to be completed, otherwise false (the user selected Complete Word from the IntelliSense menu with the caret not positioned immediately after any text. This displays all possible completions).

Remarks

This method is called when the CompletionSet object that was created in the call to the CreateCompletionSet method in the Source class is about to be used to show a completion list. This method allows the same CompletionSet object to be reused.

The base method first calls the Close method and then caches the IVsTextView object and the Declarations object. The base method then returns immediately if the Declarations object is empty. Otherwise, the base method calls the UpdateCompletionStatus method on the IVsTextView object with the flag UCS_NAMESCHANGED. If the completeWord parameter is true, the flag UCS_COMPLETEWORD is also given to UpdateCompletionStatus. If UpdateCompletionStatus fails, a COMException exception is thrown. Finally, the base method sets the internal flag indicating the display is visible.

.NET Framework Security

See Also

Reference

CompletionSet Class

CompletionSet Members

Microsoft.VisualStudio.Package Namespace