Partilhar via


DefaultFieldValue Class

Associates a default value with a field name as defined in a code snippet template for a language service.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Package.DefaultFieldValue

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

Syntax

'Declaração
Public Class DefaultFieldValue
public class DefaultFieldValue

The DefaultFieldValue type exposes the following members.

Constructors

  Name Description
Public method DefaultFieldValue Initializes a new instance of the DefaultFieldValue class.

Top

Properties

  Name Description
Public property Field Returns the name of the field.
Public property Value Returns the value of the field.

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

This class associates a field name with a string value that is considered the default value for the field. In a code snippet template, a field is a label that is placed in the code body and is replaced by a value when the code body is inserted into the source file (otherwise known as inserting a code snippet). Each field can have a value that is explicitly defined (the default value) or is obtained from an expansion function (see the ExpansionFunction class for details on expansion functions).

Notes to Implementers

There is nothing special required of implementers.

Notes to Callers

You can use this class to track default values for fields; however, this is already done for you in Visual Studio for all code snippets so there is little need to use this class.

Thread Safety

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

See Also

Reference

Microsoft.VisualStudio.Package Namespace