共用方式為


Source.GetExpansionProvider Method

Gets an expansion provider in support of code snippets.

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.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)

Syntax

'宣告
Public Overridable Function GetExpansionProvider As ExpansionProvider
public virtual ExpansionProvider GetExpansionProvider()

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

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace

Other Resources

Support for Code Snippets (Managed Package Framework)