Partager via


ExpansionProvider.GetFieldValue Method

Returns the value of the specified field.

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

Syntax

'Declaration
Public Overridable Function GetFieldValue ( _
    field As String, _
    <OutAttribute> ByRef value As String _
) As Boolean
public virtual bool GetFieldValue(
    string field,
    out string value
)
public:
virtual bool GetFieldValue(
    String^ field, 
    [OutAttribute] String^% value
)
abstract GetFieldValue : 
        field:string * 
        value:string byref -> bool  
override GetFieldValue : 
        field:string * 
        value:string byref -> bool
public function GetFieldValue(
    field : String, 
    value : String
) : boolean

Parameters

  • field
    Type: String

    [in] A string containing the name of the field for which to get a value.

  • value
    Type: String%

    [out] A string containing the value of the field.

Return Value

Type: Boolean
If there is an expansion session in progress and the specified field exists and contains a value, returns true; otherwise, returns false.

Remarks

A field is a part of the snippet template for which different values can be substituted, possibly from an expansion function.

The base method calls the GetFieldValue method on the IVsExpansionSession object that was obtained in the InsertSpecificExpansion or InsertNamedExpansion methods.

.NET Framework Security

See Also

Reference

ExpansionProvider Class

Microsoft.VisualStudio.Package Namespace