Parent: Object
Descendants: many
The Configurable class provides base functionality for WealthLab components that support configuration. Configurable implements the IParameterized and INamed interfaces. Configuration can be represented either as a plain string or as a persisted ParameterList, as determined by the ConfigurableType property. The Configurable constructor calls GenerateParameters and then LoadConfig, so derived classes can define their Parameters and automatically restore previously saved configuration when they are instantiated.
Returns the key used to persist the object's Configuration in the WL9 settings file. If ConfigPrefix is blank, the key is simply Name. Otherwise, it is composed of ConfigPrefix + "_" + Name. Override this property when a different configuration key is required.
Returns the prefix used when constructing ConfigKey. The default value is a blank string. Derived classes can override this to provide a prefix appropriate for the component type.
Determines how the object's Configuration string is represented. ConfigurableType.VanillaString indicates that the component manages its configuration as a plain string. ConfigurableType.ParameterList indicates that the Configuration represents a persisted ParameterList, available through the Parameters property.
Gets or sets the object's configuration as a string. For ConfigurableType.VanillaString, the value is stored directly. For ConfigurableType.ParameterList, the getter returns the persisted representation of Parameters, and assigning a value parses it as a ParameterList and assigns its values to the existing Parameters. ProcessConfig is called when the configuration changes.
Displays the configuration interface by calling EditConfig. If the configuration was changed, the new configuration is persisted by calling SaveConfig and the method returns true. Otherwise, it returns false.
Loads the persisted configuration and checks IsConfigured. If the object is not configured, calls Configure to allow the user to configure it. Returns true if the object is already configured or configuration succeeds.
Causes WL9 to display an interface that allows the user to edit the object's configuration. The default implementation assigns the object's Description and itself as the Caller of its ParameterList, then passes the object to the WL9 host for configuration.
Override this method to populate the object's Parameters property. The Configurable constructor calls this method before loading persisted configuration, allowing the existing Parameter instances to receive the persisted values.
Returns whether the object requires configuration. The default implementation returns true when ConfigurableType is ConfigurableType.ParameterList and Parameters contains at least one Parameter. It returns false otherwise.
Returns whether the object is properly configured. If IsConfigurable is false, this property returns true. Otherwise, it attempts to load the configuration if it is currently blank and returns whether a non-empty Configuration is available.
Return true to keep configuration Parameters synchronized among Configurable instances that share the same ConfigKey. When the Configuration of one such instance changes, matching companion instances receive the same Parameter values. The default value is false.
Loads the object's configuration from the WL9 settings using ConfigKey. If a stored configuration is found, it is assigned to Configuration and the method returns true. Otherwise, it returns false.
Gets or sets the ParameterList containing the object's configuration Parameters. When persisted Parameters are assigned, Configurable preserves the Parameter instances generated by the constructor while adopting their persisted values and optimization-related settings. This allows newly introduced Parameters to remain present when loading configuration saved by an earlier version.
Called after the object's Configuration changes. Override this method to perform any additional processing required by the new configuration. The default implementation assigns the object's Description to the Parameters' Description property.
Persists the current Configuration in the WL9 settings using ConfigKey. The setting is updated only if the persisted value differs from the current Configuration.
Returns an optional short description of the component. The default value is a blank string. WL9 can display this description when the component is being configured.
Determines whether WL9 should suppress automatic reversal of the component's glyph when displaying it in a Dark Theme. The default value is false.
Returns the qualified name of an embedded resource containing the image that WL9 should use to represent the component. The default value is a blank string.
Returns a Stream containing the embedded resource specified for the object's glyph.
Returns the name of the component. Configurable implements the INamed interface.
Returns an optional URL containing additional information about the component. The default value is a blank string.
Adds a StringChoice Parameter whose choices correspond to the possible values of the enum represented by enumInstance. The Parameter's default value is the supplied enum value, and its TypeName is set to the enum type's name. Returns the newly created Parameter.
Adds an indicator Parameter to Parameters. The method sets its IndicatorAbbreviation and attempts to create the specified indicator using IndicatorFactory. If successful, the Parameter's IndicatorParameters and IndicatorInstance properties are populated from the indicator instance. Returns the newly created Parameter.
Creates a Parameter with the specified label, ParameterType, and defaultValue, adds it to Parameters, and returns the newly created Parameter.
Adds a StringChoice Parameter to Parameters and returns it. The available choices are:
- less than
- less than or equal to
- equal to
- not equal to
- greater than or equal to
- greater than