Default implementation of the IConfigScope interface that allows new local variables to be added to the scope.
sealed class
|
ConfigScope
|
implements
|
IConfigScope
|
An empty IConfigScope instance.
public
static
readonly
field
|
Empty
|
||
type
|
IConfigScope
|
The number of named objects in the bag.
public
property
|
Count
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of named objects. | |
implements
|
IConfigTypeBag.Count
|
The names of all objects in the bag.
public
property
|
Names
{
get
}
|
||
type
|
IBagConst<string>
|
||
value
|
|
The object names. | |
implements
|
IConfigTypeBag.Names
|
Returns the current version of object.
public
property
|
Version
{
get
}
|
||
type
|
int32
|
||
value
|
The current version number. | ||
implements
|
IVersioned.Version
|
Remarks:
For each modification, the version is incremented by at least one.
Creates a new instance of ConfigScope.
public
constructor
|
ConfigScope
(IConfigValueBag parent = null)
|
||
params
|
parent
|
The
parent
scope
or
null . |
Adds a new variable to this scope, without initializing it.
public
method
|
AddVariable
(string name,
ConfigType type)
|
||
params
|
name
|
[not-empty]
|
The variable name. |
type
|
[not-null]
|
The variable type. |
Remarks:
If a variable of the given name already exists, it will be replaced.
Adds a new variable to this scope, without initializing it.
public
method
|
AddVariable
(string name,
ConfigExpression expr)
|
||
params
|
name
|
[not-empty]
|
The variable name. |
expr
|
[not-null]
|
The variable type. |
Remarks:
If a variable of the given name already exists, it will be replaced.
Adds a new variable to this scope.
public
method
|
AddVariableAndSet
(string name,
ConfigType type)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-empty]
|
The variable name. |
type
|
[not-null]
|
The variable type. | |
returns
|
|
The config value object of the added variable. |
Remarks:
If a variable of the given name already exists, it will be replaced.
Adds a new variable to this scope.
public
method
|
AddVariableAndSet
(string name,
ConfigExpression value)
|
||
params
|
name
|
[not-empty]
|
The variable name. |
value
|
[not-null]
|
The variable value. |
Remarks:
If a variable of the given name already exists, it will be replaced.
Checks if this bag contains an object of the given name.
public
method
|
Contains
(string name)
|
||
type
|
bool
|
||
params
|
name
|
[not-null]
|
The name. |
returns
|
true
if
the
bag
contains
an
object
named
name,
false
if
it
does
not.
|
||
implements
|
IConfigTypeBag.Contains
|
Looks in the config domain of this bag and tries to find the bag of the given name.
public
method
|
GetDomain
(string name)
|
||
type
|
IConfigValueBag
|
||
params
|
name
|
Name
of
the
bag
to
find
or
null
to
return
this
bag. |
|
returns
|
|
The type bag. Will be empty if not found. | |
implements
|
IConfigTypeBag.GetDomain
|
Returns the ConfigMember which corresponds to the given named config object.
public
method
|
GetMemberNull
(string name)
|
||
type
|
ConfigMember
|
||
params
|
name
|
[not-null]
|
The name. |
returns
|
The
ConfigMember
or
null . |
||
implements
|
IConfigValueBag.GetMemberNull
|
Returns the config type that is associated with the given name, for example the type of a script variable.
public
method
|
GetTypeNull
(string name)
|
||
type
|
ConfigType
|
||
params
|
name
|
[not-null]
|
The name. |
returns
|
The
associated
config
type
of
null
if
not
found. |
||
implements
|
IConfigTypeBag.GetTypeNull
|
Returns the config value that has the given name.
public
method
|
GetValueNull
(string name,
ConfigValue[] arguments = null)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The name. |
arguments
|
Optional
arguments
for
function
call.
If
null ,
a
field
value
is
accessed.
When
not
null ,
a
function
call
is
performed.
Defaults
to
null .
|
||
returns
|
The
object
or
null
if
there
is
no
object
named
name.
|
||
implements
|
IConfigValueBag.GetValueNull
|
Tries to resolve the given incomplete name of a config type, using some additional information from the scope (for example using directives).
public
method
|
ResolveTypeNull
(string name)
|
||
type
|
ConfigType
|
||
params
|
name
|
[not-empty]
|
The incomplete config type name. |
returns
|
The
config
type
or
null . |
||
implements
|
IConfigScope.ResolveTypeNull
|
See also:
ConfigType.GetNullSets a variable value in this scope.
public
method
|
SetVariable
(string name,
ConfigValue value)
|
||
params
|
name
|
[not-empty]
|
The variable name. |
value
|
[not-null]
|
The variable value. | |
implements
|
IConfigScope.SetVariable
|