Abstract base class for IConfigurator implementations that configure reference-type objects.
abstract class
|
ConfiguratorObject
|
with
|
<T>
|
as
|
class, IConfigurable
|
extends
|
ConfiguratorBase<T>
|
||||
implements
|
IConfiguratorObject
|
||||
base of
|
GraphicsContextFactory_Config
|
Returns the configuration type of this configurator.
public
abstract
property
|
Type
{
get
}
|
||
type
|
ConfigType
|
||
value
|
|
The configuration type. | |
inherited
|
ConfiguratorBase.Type
|
Creates a new instance from a field of the given configuration value.
[OwnerReturn]
|
||||
public
method
|
FromField
(ConfigValue config,
string field)
|
|||
type
|
T
|
|||
params
|
config
|
[not-null]
|
The configuration value. | |
field
|
[not-null]
|
Field name. | ||
returns
|
|
The created instance. | ||
inherited
|
ConfiguratorBase.FromField
|
Creates a new instance from the given configuration entity.
[OwnerReturn]
|
||||
public
method
|
FromScript
(ConfigScript script,
string name)
|
|||
type
|
T
|
|||
params
|
script
|
[not-null]
|
The config script. | |
name
|
[not-null]
|
Name of the entity. | ||
returns
|
|
The created instance. | ||
inherited
|
ConfiguratorBase.FromScript
|
Creates a new instance from the given configuration value.
[OwnerReturn]
|
||||
public
override
sealed
method
|
FromValue
(ConfigValue config)
|
|||
type
|
T
|
|||
params
|
config
|
[not-null]
|
The configuration value. | |
returns
|
|
The created instance. | ||
overrides
|
ConfiguratorBase.FromValue
|
Creates an array of instances from the given configuration value.
[OwnerReturn]
|
||||
public
method
|
FromValueArray
(ConfigValue config)
|
|||
type
|
T[]
|
|||
params
|
config
|
[not-null]
|
The configuration value. | |
returns
|
The
resulting
array
or
null
if
config
contains
zero
elements.
|
|||
inherited
|
ConfiguratorBase.FromValueArray
|
Creates an array of instances from the given configuration value.
[OwnerReturn]
|
||||
public
method
|
FromValueList
(ConfigValue config)
|
|||
type
|
IVector<T>
|
|||
params
|
config
|
[not-null]
|
The configuration value. | |
returns
|
The
resulting
array
or
null
if
config
contains
zero
elements.
|
|||
inherited
|
ConfiguratorBase.FromValueList
|
Creates a new instance from the given configuration value.
[OwnerReturn]
|
||||
public
method
|
FromValuePlain
(ConfigValue value)
|
|||
type
|
IConfigurable
|
|||
params
|
value
|
[not-null]
|
The configuration value. | |
returns
|
|
The created instance. | ||
implements
|
IConfiguratorObject.FromValuePlain
|
This is a no-op method that forces the compiler / linker to include this type in the resulting binary.
public
method
|
PleaseIncludeInBinaryThanks
()
|
||
inherited
|
ConfiguratorBase.PleaseIncludeInBinaryThanks
|
Remarks:
Calling this stub method makes sure that all lazy constructor calls have been made.
To initialize everything, an application needs to call this method on its root module(s) (see TinmanModule), followed by a call to PleaseIncludeInBinaryThanksAll.
Returns the configuration value that describes the given object.
public
override
sealed
method
|
ToValue
(T instance)
|
||
type
|
ConfigValue
|
||
params
|
instance
|
The object. | |
returns
|
|
The configuration value. | |
implements
|
ConfiguratorBase.ToValue
|
Remarks:
The returned value may be of type Invalid, which means that the given object in its current state cannot be described with the configuration API.
Returns the configuration value that describes the given objects.
public
method
|
ToValueArray
(T[] instances)
|
||
type
|
ConfigValue
|
||
params
|
instances
|
The object. | |
returns
|
|
The configuration array value. | |
inherited
|
ConfiguratorBase.ToValueArray
|
Remarks:
The returned value may be of type Invalid, which means that the given object in its current state cannot be described with the configuration API.
Returns the configuration value that describes the given objects.
public
method
|
ToValueList
(IVectorConst<T> instances)
|
||
type
|
ConfigValue
|
||
params
|
instances
|
The object. | |
returns
|
|
The configuration array value. | |
inherited
|
ConfiguratorBase.ToValueList
|
Remarks:
The returned value may be of type Invalid, which means that the given object in its current state cannot be described with the configuration API.
Performs custom validation of the given value.
public
virtual
method
|
ValidateValue
(ConfigValue value,
Validator validator)
|
||
params
|
value
|
[not-null]
|
The value to validate. |
validator
|
[not-null]
|
The validator object. | |
implements
|
IConfiguratorObject.ValidateValue
|
Configures a native value from the given config value.
[OwnerReturn]
|
||||
protected
override
method
|
DoFromValue
(ConfigValue config)
|
|||
type
|
T
|
|||
params
|
config
|
The
config
value
(will
never
be
null ). |
||
returns
|
The configured native value. | |||
overrides
|
ConfiguratorBase.DoFromValue
|
Remarks:
If the implementing method does not know how to configure a native object from config, it can try to delegate to a more specific configurator by calling the base implementation.
This default implementation always throws a ConfigException.
The default implementation of ConfiguratorObject delegates the process of configuring a native object from config to a more specific configurator, defined by a derived type of Type.
Converts the given native object to a config value.
[EmptyBody]
|
||||
protected
virtual
method
|
DoToValue
(T instance)
|
|||
type
|
ConfigValue
|
|||
params
|
instance
|
The
native
object
(will
never
be
null ). |
||
returns
|
The
config
value
or
null
if
this
configurator
cannot
express
instance
as
a
config
value.
|
Remarks:
This
method
will
never
be
called
for
null
references.
Those
will
always
be
translated
to
Null.
If
this
method
returns
null
,
the
ToConfig
method
of
the
native
object
will
be
used
instead.
The Cache method must not be called on the returned value.
The
default
implementation
returns
null
.