Table of Contents

Class DataValueDescriptor

Namespace
Acuit.Pinpoint.IO.Testing.Data
Assembly
Acuit.Pinpoint.IO.Testing.Abstractions.dll

The default IDataValueDescriptor implementation.

public class DataValueDescriptor : IDataValueDescriptor
Inheritance
DataValueDescriptor
Implements
Derived
Inherited Members

Constructors

DataValueDescriptor(string, string, string)

Initializes a new instance of the DataValueDescriptor class.

public DataValueDescriptor(string displayFormat, string serializeFormat, string units)

Parameters

displayFormat string

The display format, for use with ToString(string, IFormatProvider).

serializeFormat string

The serialize format, for use with ToString(string, IFormatProvider).

units string

The units, or null.

Exceptions

ArgumentNullException

displayFormat is null.

ArgumentNullException

serializeFormat is null.

Properties

Basic

Gets a data value descriptor that does not use units and or any special value formatting.

public static DataValueDescriptor Basic { get; }

Property Value

DataValueDescriptor

Units

Gets the units of measurement, or null if there are none.

public string Units { get; }

Property Value

string

Methods

Format(object, string, IFormatProvider)

Formats a data value using the specified format.

public virtual string Format(object value, string format, IFormatProvider formatProvider)

Parameters

value object

The value to format.

format string

The format to use (see remarks), or null to use the default display format ("D").

formatProvider IFormatProvider

The provider to use to format the value, or null to obtain the format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.

Remarks

The following format values are valid for format:

G - The general format, which is the same as D. D - The display format, which includes the formatted data value along with the units, if it has any. Example: 1,234.5 psi V - The value format, which is the display format without units. Example: 1,234.5 S - The serialization format. Note that formatProvider is ignored (InvariantCulture is always used). Example: 1234.5

Exceptions

FormatException

The format string is not supported.