Partilhar via


IVsExpansionFunction Interface

Definition

Represents an expansion function in a code snippet.

public interface class IVsExpansionFunction
public interface class IVsExpansionFunction
__interface IVsExpansionFunction
[System.Runtime.InteropServices.Guid("563011A2-1611-48ED-B3B1-189060064F66")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsExpansionFunction
[System.Runtime.InteropServices.Guid("563011A2-1611-48ED-B3B1-189060064F66")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsExpansionFunction
[<System.Runtime.InteropServices.Guid("563011A2-1611-48ED-B3B1-189060064F66")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsExpansionFunction = interface
[<System.Runtime.InteropServices.Guid("563011A2-1611-48ED-B3B1-189060064F66")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsExpansionFunction = interface
Public Interface IVsExpansionFunction
Derived
Attributes

Remarks

An expansion function in a code snippet is a function name associated with a particular field that represents a single value or a list of values (which is presented in an IntelliSense completion list). See Function Element (Intellisense Code Snippets) for details on how expansion functions are declared in a code snippet file.

The function name obtaisn an expansion function object as represented by the IVsExpansionFunction interface from a language service. That IVsExpansionFunction object is then asked for the value or values to be presented in the field when the code snippet is inserted. This gives for dynamically generated values based on the context in which the code snippet is inserted.

Note

An expansion function represents either a single value or a list of values but it cannot represent both.

Notes to Implementers

A language service implements this interface to represent an expansion function. For each distinct expansion function supported, the language service must return a unique implementation of this interface. For example, if the language service supports two expansion functions, say, GetLocalName and GetNextClassName, it must implement a separate class to the IVsExpansionFunction interface for each expansion function. Then, the language service must return an instance of each class for each expansion function.

Notes to Callers

An IVsExpansionFunction object is returned from the GetExpansionFunction(IXMLDOMNode, String, IVsExpansionFunction) method in the IVsExpansionClient interface.

Methods

FieldChanged(String, Int32)

Called when another field in the inserted code snippet is changed.

GetCurrentValue(String, Int32)

Returns the current value of the expansion function.

GetDefaultValue(String, Int32)

Returns the default string to be inserted before any template is edited.

GetFunctionType(UInt32)

Returns the type of this expansion function (value or list of values).

GetListCount(Int32)

Returns the number of items in the list of values associated with the expansion function.

GetListText(Int32, String)

Returns the specified value from a list of values associated with the expansion function.

ReleaseFunction()

Called when the expansion function is no longer needed.

Applies to