Export (0) Print
Expand All

Declarations Class

Manages a list of declarations to be shown in an IntelliSense drop-down list.

This API is not CLS-compliant. The CLS-compliant alternative is [None].

System.Object
  Microsoft.VisualStudio.Package.Declarations

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  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)

[CLSCompliantAttribute(false)]
public abstract class Declarations : IDisposable

The Declarations type exposes the following members.

  NameDescription
Protected methodDeclarationsInitializes a new instance of the Declarations class.
Top

  NameDescription
Public propertyLastBestMatchGets or sets the name of the item that best matches what has been typed so far.
Top

  NameDescription
Public methodDisposeFrees any resources allocated by the class just before the class object is destroyed.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBestMatchDetermines the best completion match for the specified value.
Public methodGetCountWhen implemented in a derived class, gets the number of items in the list of declarations.
Public methodGetDescriptionWhen implemented in a derived class, gets a description of the specified item.
Public methodGetDisplayTextWhen implemented in a derived class, gets the text to be displayed in the completion list for the specified item.
Public methodGetGlyphWhen implemented in a derived class, gets the image to show next to the specified item.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetInitialExtentReturns the initial extent of the text to be completed.
Public methodGetNameWhen implemented in a derived class, gets the name or text to be inserted for the specified item.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsCommitCharDetermines whether the specified character can be used to complete the specified text.
Public methodIsMatchDetermines whether the specified text matches some or all of the specified item.
Public methodIsPerfectMatchDetermines whether the specified text matches all of the specified item.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnAutoCompleteCalled after the declaration has been committed to the source file. When implemented in a derived class, it provides a completion character which may itself be a trigger for another round of IntelliSense.
Public methodOnCommitCalled to commit the specified item to the source file.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

This abstract class is used to manage a list of identifiers or declarations that are shown in an IntelliSense member completion list. If you intend to support IntelliSense in your application, you must provide a concrete class that derives from this class.

Notes to Implementers

The implemented methods of this class assume that the declarations are stored in a list that is sorted in ascending order.

If you intend to support the IntelliSense completion list, you must derive a class from the Declarations class and implement the following abstract methods:

Abstract Method

Description

GetCount

Returns number of items in declarations list

GetDescription

Returns description for specified item.

GetDisplayText

Returns text to be shown in the completion list for the specified item.

GetGlyph

Returns an index into an image list for the specified item.

GetName

Returns the text to be inserted for the specified item.

Notes to Callers

An instance of this class is returned from the GetDeclarations method in the AuthoringScope class. The GetDeclarations method must be implemented in a class derived from the AuthoringScope class. How your version of the Declarations class is populated is entirely up to you. The Declarations class is populated by the parser.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft