You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is no way to get a handle on the 'current' configurator in script. We only have a handle to the static Configurator which represents the latest configurator in the cascade chain, as controlled by Configurator.Load();.
The new syntax will allow the following in script:
Add("foo",123);
I.e. no reference to the static Configurator when adding. This adds the value to the current configurator. If the configurator is loaded via a call to one of the static Configurator.Load() methods then its values still form part of the cascading values.
It will still be possible to read values in script using the Configurator.Get() methods. Of course, it will also still be possible to add values using Configurator.Add() in script, but this would be pathological.
The text was updated successfully, but these errors were encountered:
Need to preserve static addition - this is useful for communicating values from app to script, e.g. version, which can be used to execute versioned config.
The best idea is probably to always implicitly ensure a basic configurator is present to receive statically added values. This means statically added values will always have no 'source', they just come from code somewhere. This is probably OK. When adding values through scripts the new local Add() method should be used which will convey source info and ensure that the items belong to the current configurator when using isolated scripts.
We can also consider providing a deprecated, backward behaviour preserving, IConfigRScriptHost.Configurator which wraps the local Add()/Set(). Although would the Get() have to wrap the static Get()?
Important to note that the only way to remove the deprecated member later would be to break the calls by changing Add()/Set() to something else. One option is to delay the change from Add() to Set() until then.
Allows things like:
Currently there is no way to get a handle on the 'current' configurator in script. We only have a handle to the static
Configurator
which represents the latest configurator in the cascade chain, as controlled byConfigurator.Load();
.The new syntax will allow the following in script:
I.e. no reference to the static
Configurator
when adding. This adds the value to the current configurator. If the configurator is loaded via a call to one of the staticConfigurator.Load()
methods then its values still form part of the cascading values.It will still be possible to read values in script using the
Configurator.Get()
methods. Of course, it will also still be possible to add values usingConfigurator.Add()
in script, but this would be pathological.The text was updated successfully, but these errors were encountered: