Role: A setting controller manages all or only a part of the parameters available in a property page of the dialog displayed using the Options command of the Tools menu. Each setting parameter may be represented by one or several setting attribute in the underlying setting repository.
All setting controllers share the five methods of the SettingController object to deal with the whole set, or a subset of the setting attributes:
Committo make a memory copy of the setting attribute valuesRollbackto restore the last memory copy of the setting attribute valuesResetToAdminValuesto restore the administered values of all the attributesResetToAdminValuesByNameto restore the administered values of a subset of the attributesSaveRepositoryto make a persistent copy of the setting attribute values on file.
In addition, each setting controller exposes four methods per setting parameter: two methods to access the setting attribute values, that usually make up a read/write property if the setting parameter is represented by a single setting attribute, a method to manage the setting parameter lock, and a method to retrieve the state of the setting parameter. The first two methods are parameter-specific and are fully described in the setting controller object that managing the setting parameter. The last two methods have always the same signature and the same behavior whatever the setting parameter. They are described below. PARAMETER is used in place of the actual setting parameter name.
- Managing the Setting Parameter Lock
HRESULT SetPARAMETERLock(in boolean iLocked);
Locks or unlocks the PARAMETER setting parameter.
Role: Locking a setting parameter prevents the end user, or the administrators below the current one, from changing the setting parameter value. Locking or unlocking the PARAMETER setting parameter is an administrator task and is possible when running a session in the administration mode only.- Parameters
-
iLocked- [in] A flag to indicate whether the PARAMETER setting parameter
should be locked.
Legal values:Trueto lock, andFalseto unlock.
- Retrieving the Setting Parameter State
HRESULT GetPARAMETERInfo (inout CATBSTR ioAdminLevel, inout CATBSTR ioLocked, out /*IDLRETVAL*/ boolean oModified);Retrieves information about the PARAMETER setting parameter.
Role: This information defines the state of the setting parameter and is made up of:- The administration level that sets the current value or the value used to reset it
- The administration level that has locked the setting parameter.
- A flag to indicate whether the setting parameter was modified.
- Parameters
-
ioAdminLevel- [inout]
The administration leve that defines the value used when resetting the
setting parameter.
Legal values:
- Default value if the setting parameter has never been explicitly set in the administration concatenation.
- Set at Admin Level n if the setting parameter has been
administered,
where n is an integer starting from 0 representing the rank of the administration level.
ioLocked- [inout]
A character string to indicate whether the parameter is locked and the level
of administration where the locking has been proceeded.
Legal values:- Locked at Admin Level n if the setting parameter is locked by
then administration level n,
where n is an integer starting from 0. The setting parameter can not be modified at the current level. - Locked if the setting parameter is locked by the current administration level. Only an admistrator can get this value.
- Unlocked if the setting parameter is not locked
- Locked at Admin Level n if the setting parameter is locked by
then administration level n,
- Returns
- True to indicate that the setting parameter value has been explicitely modified at the current administrator or user level. This is only possible with unlocked parameters. False means that it inherits the administered value.
Methods
- Sub Commit()
-
Makes a memory copy of the setting attribute values.
Role:Commitsaves the current values of the setting attributes managed by the setting controller in a specific memory area. Successive calls toCommitoverwrite the memory area. The values saved by the last call toCommitcan be restored from that memory area using the method. - Sub ResetToAdminValues()
-
Restores the administrated values of the all attributes.
Role:ResetToAdminValuesrestores all the values of the setting attributes managed by the setting controller to either the values set by the setting administrator, or to their default values if the setting administrator did not change them. - Sub ResetToAdminValuesByName( iAttList)
-
Restores the administrated values of a subset of the attributes.
Role:ResetToAdminValuesByNamerestores the values of a subset of the setting attributes managed by the setting controller to either the values set by the setting administrator, or to their default values if the setting administrator did not change them.- Parameters:
-
- iAttList
- The attribute subset to which the administrated values are to be restored dd>
- Sub Rollback()
-
Restores the last memory copy of the setting attribute values.
Role:Rollbackrestores the values of the setting attributes managed by the setting controller from the memory area. All values of the setting attributes managed by the setting controller modified since the last call to are restored to the values they had when this last was called. - Sub SaveRepository()
-
Makes a persistent copy of the setting attribute values on file.
Role:SaveRepositorysaves the current values of the setting attributes managed by the setting controller in a setting repository file. To avoid inconsistencies,SaveRepositoryfirst saves the values in the memory area used by the method by calling before writing the values in the setting repository file.