Share via


DataSpecifier Class

Represents a utility class that provides the ability to parse and resolve data specifiers.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.Framework.DataSpecifier

Namespace:  Microsoft.VisualStudio.Data.Framework
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
Public NotInheritable Class DataSpecifier
public sealed class DataSpecifier
public ref class DataSpecifier sealed
[<Sealed>]
type DataSpecifier =  class end
public final class DataSpecifier

The DataSpecifier type exposes the following members.

Properties

  Name Description
Public property Alignment Gets the portion of the data specifier string that represents the alignment component.
Public property FormatString Gets the portion of the data specifier string that represents the formatString component.
Public property Qualifier Gets the portion of the data specifier string that represents the qualifier component.
Public property Specifier Gets the portion of the data specifier string that represents the specifier component.

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member Parse(String) Parses a data specifier string into its components and returns a DataSpecifier object instance containing the parsed components.
Public methodStatic member Parse(String, Int32%) Parses a data specifier string, starting at the specified index, into its components and then returns a DataSpecifier object instance containing the parsed components.
Public methodStatic member Resolve(String, DataSpecifier.Resolver) Converts the data specifier string into its textual representation by using the specified delegate resolver method.
Public methodStatic member Resolve(String, Int32%, DataSpecifier.Resolver) Converts the data specifier string, starting at the specified index, into its textual representation by using the specified delegate resolver method.
Public methodStatic member ResolveAll Converts a string of one or more data specifiers into its textual representation by using the specified delegate resolver method.
Public method ToString Returns a string representation consisting of all the components of the specified DataSpecifier object. (Overrides Object.ToString().)

Top

Remarks

Data specifiers specify the display format of a string. They are strings of the form {[qualifier.]specifier[,alignment][:formatString]}. Below is a more detailed description of each component of the data specifier string:

qualifier

  • The optional qualifier component is the name of the entity that the specifier property belongs to.

specifier

  • The required specifier component is the property to identify.

alignment

  • The optional alignment component is a signed integer indicating the preferred formatted field width. If the value of alignment is less than the length of the formatted string, alignment is ignored and the length of the formatted string is used as the field width. The formatted data in the field is right-aligned if alignment is positive and left-aligned if alignment is negative. If padding is necessary, white space is used. The comma is required if alignment is specified.

formatString

  • The optional formatString component is a format string that is appropriate for the type of object being formatted. Specify a numeric format string if the corresponding object is a numeric value, a date and time format string if the corresponding object is a DateTime object, or an enumeration format string if the corresponding object is an enumeration value. If formatString is not specified, the general (G) format specifier for a numeric, date and time, or enumeration type is used. The colon is required if formatString is specified.

As an example, data specifiers are present in the data object view XML file to specify the appearance of nodes in Server Explorer. In particular, the default connection node name is specified in the XML file in the InitialDisplayName tag under the ConnectionNode tag as the following collection of data specifiers: {Root.Name}.{Name}.{DefaultSchema}.

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.Data.Framework Namespace