Table of Contents

Class ReadingAttribute

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

An attribute that marks a property as a reading that provides a non-numeric data value.

[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class ReadingAttribute : ReadingBaseAttribute, _Attribute
Inheritance
ReadingAttribute
Implements
Inherited Members

Constructors

ReadingAttribute(int)

Initializes a new instance of the ReadingAttribute class.

public ReadingAttribute(int order = 0)

Parameters

order int

The relative order of this reading. The default value will be the line number of the property, which will effectively result in readings being ordered in the same order as they are declared in the source code.

Properties

DisplayFormat

Gets or sets the display format, for use with ToString(string, IFormatProvider). It defaults to "G".

public string DisplayFormat { get; set; }

Property Value

string

SerializeFormat

Gets or sets the serialize format, for use with ToString(string, IFormatProvider). It defaults to "G".

public string SerializeFormat { get; set; }

Property Value

string

Methods

GetReadingDescriptor(PropertyInfo)

Gets the reading descriptor for the reading.

public override IAttributedReadingDescriptor GetReadingDescriptor(PropertyInfo propertyInfo)

Parameters

propertyInfo PropertyInfo

The property to which this attribute is applied.

Returns

IAttributedReadingDescriptor

An IAttributedReadingDescriptor.

Exceptions

ArgumentNullException

propertyInfo is null.

InvalidOperationException

propertyInfo is not compatible with this reading attribute.