IConfigurableTrait

Description

[StaticTemplate]
interface Tinman.Core.Config.Binding.IConfigurableTrait

Extended by

ColorF struct
ColorSwizzle struct
ContourRange struct
CubemapFaceCoordsI struct
CubemapFaceRect struct
DatasetId struct
HeightmapSample struct
Mat2D struct
Mat2F struct
Mat3D struct
Mat3F struct
Mat4D struct
Mat4F struct
MaterialKey struct
MultiSampleType struct
PixelRange struct
RangeD struct
RangeF struct
RangeI struct
RangeL struct
SampleLayout struct
Vec2D struct
Vec2F struct
Vec2I struct
Vec2L struct
Vec3D struct
Vec3F struct
Vec3I struct
Vec3L struct
Vec4D struct
Vec4F struct
Vec4I struct
Vec4L struct
VerticalRange struct

Type trait for values that can express themselves as a config value.

See also

IConfigurable

Public / Methods

To​Config


public method ToConfig → ()

returns → ConfigValue

The configuration value, which will never be ConfigValue.Invalid.

Returns the configuration value that describes this value.

Each type that implements this trait is associated with a IConfigurator object, which performs the actual conversion to and from ConfigValue. By convention, the type should declare a public and static read-only property named Config, to make the association explicit:

public static IConfigurator<MyType> Config
{
  get { return ...; }
}

If the configurator uses a different value type, the documentation should mention the used conversion method.

Calling ToConfig is equivalent to calling IConfigurator.ToValue on the associated configurator, so an implementing method will usually just delegate to the configurator:

public ConfigValue ToConfig()
{
  return Config.ToValue(this);
}
ConfigException

If an unexpected error has occurred while building the config value.