MetaValue

References
Represents a meta data value. This is really just a wrapper class around all the supported meta data value types so we don't have to use 'object' to store meta data.

Fields

AssistantPrefix

#
String prefix for values serialised via their ITypeAssistant.
public const string AssistantPrefix = "A:"

JsonPrefix

#
String prefix for values serialised using Json (de)serialisation.
public const string JsonPrefix = "J:"

StorablePrefix

#
String prefix for values serialised using the IStorable approach.
public const string StorablePrefix = "S:"

Properties

Assistant

#
Gets the type assistant for the data inside this value.
public ITypeAssistant Assistant { get; }

IntendedData

#
Gets the intended value. This may return null as well as an IPear instance if the internal data can be successfully deserialised.
public object IntendedData { get; }

InternalData

#
Gets the internal instance of the data. Typically you know what data type you're looking for and you don't have to rawdog the value directly.
public object InternalData { get; }

IsSerialisedData

#
Gets whether this value contains serialised data. For this to be true, the value must be of type string and start with one of the format identifiers.
public bool IsSerialisedData { get; }

Null

#
Gets a null meta value.
public static MetaValue Null { get; }

Type

#
Gets the type of meta data.
public MetaType Type { get; }

Methods

CompareTo

#
public static int CompareTo()

CompareTo

#
public int CompareTo(
other
)

Equals

#
public static bool Equals()

Equals

#
public bool Equals(
other
)

FormatValue

#
public static string FormatValue(
value
)

Get

#
Gets the value as an angle.
public bool Get(
out Angle
value
)

Get

#
Gets the value as an integer.
public bool Get(
value
)

Get

#
Gets the value as a boolean.
public bool Get(
out bool
value
)

Get

#
Gets the value as an array of bytes.
public bool Get(
out byte[]
value
)

Get

#
Gets the value as an Eto color.
public bool Get(
out Color
value
)

Get

#
Gets the value as a Grasshopper colour.
public bool Get(
out Colour
value
)

Get

#
Gets the value as a date.
public bool Get(
value
)

Get

#
Gets the value as a number.
public bool Get(
out double
value
)

Get

#
Gets the value as a univariate function.
public bool Get(
value
)

Get

#
Gets the value as a colour gradient.
public bool Get(
value
)

Get

#
Gets the value as an id.
public bool Get(
out Guid
value
)

Get

#
Gets the value as an integer.
public bool Get(
out int
value
)

Get

#
Gets the value as an interval.
public bool Get(
value
)

Get

#
Gets the value as a plane.
public bool Get(
out Plane
value
)

Get

#
Gets the value as a point.
public bool Get(
out Point3d
value
)

Get

#
Gets the value as a string.
public bool Get(
out string
value
)

Get

#
Gets the value as a time.
public bool Get(
value
)

Get

#
Gets the value as a transformation.
public bool Get(
value
)

Get

#
Gets the value as a vector.
public bool Get(
value
)

GetHashCode

#
public override int GetHashCode()

IsSupportedType

#
Tests whether a value could be used inside meta data.
public static bool IsSupportedType(
value
)

Parse

#
Try and parse a string. This always works since STRING is a valid meta type, but you may not get the conversion you were expecting.
public static MetaValue Parse(
text,
Text to parse.
hint
Optional original data. This is required for data which is partially formatted or ambiguous.
)
Meta value. May be Null.

Restore

#
public static MetaValue Restore(
reader
)

Store

#
Serialiser. This class does not implement IStorable because that would break file IO with early versions. Instead, the data is written directly into the supplied writer object, so it's the responsibility of the caller to make sure multiple meta values do not collide within the same writer.
public void Store(
writer
)

ToString

#
public override string ToString()
Object.ToString

TryCreate

#
Try and create a meta value from any value. If the value is of a supported type, this method will succeed.
public static bool TryCreate(
value,
meta,
out string
failure
)

TryDeserialise

#
Try and deserialise a value from a string for the purposes of meta-data storage.
public static bool TryDeserialise(
text,
out IPear
pear,
out Message
failure
)

TrySerialise

#
Try and serialise a value to a string for the purposes of meta-data storage.
public static bool TrySerialise(
pear,
out string
text,
out Message
failure
)

Convertors