Source.GetExpansionProvider Method
Gets an expansion provider in support of code snippets.
Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'Declaration
Public Overridable Function GetExpansionProvider As ExpansionProvider
'Usage
Dim instance As Source
Dim returnValue As ExpansionProvider
returnValue = instance.GetExpansionProvider()
public virtual ExpansionProvider GetExpansionProvider()
public:
virtual ExpansionProvider^ GetExpansionProvider()
public function GetExpansionProvider() : ExpansionProvider
Return Value
Type: Microsoft.VisualStudio.Package.ExpansionProvider
If successful, returns an ExpansionProvider object; otherwise, returns nulla null reference (Nothing in Visual Basic) (code snippet expansion is not supported).
Remarks
A code snippet is a piece of code that is inserted at the current position in the source file, either as a result of typing a completion character (which shows a list of possible completion words that include code snippet names) or selecting Insert Snippet from the IntelliSense menu. If you need to support functionality beyond what the base ExpansionProvider class supports, you must derive a class from the Source class and override this method to instantiate your own version of the ExpansionProvider class.
The base method returns an existing ExpansionProvider object or creates a new ExpansionProvider object, sets it as the existing object, and returns it.
This method is typically called from the Source constructor.
See Support for Code Snippets (Managed Package Framework) for more information about how this method is used.
.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.
See Also
Reference
Microsoft.VisualStudio.Package Namespace