The typed value.

Namespace: TeaTime
Assembly: DiscreteLogics.TeaFiles (in DiscreteLogics.TeaFiles.dll) Version: 1.0.0.16 (1.0.0.16)

Syntax

public T GetValue<T>()

Type Parameters

T
The type of the value.

Return Value

The value.

Remarks

Usually, the type of a value is known. In this case its value could be retrieved calling
CopyC#
using (var tf = TeaFile<Tick>.Create("acme.tea", null, NameValueCollection.From("decimals", 2)))
{
}

var tf = TeaFile.OpenRead("acme.tea");
int n = tf.Description.NameValues.GetValue{int}();
This will conveniently return the integer value. In the rare case were the type is not known, this method can be called with a type of object. Lets assume we are not sure if the decimals property is stored as integer, double or string. Then the code
CopyC#
object n = tf.Description.NameValues.GetValue<object>();
Console.WriteLine(n);
will return the value as plain object.

See Also