ProfileManagerAddProfileRule Method |
Namespace: Com.Datalogic.Device.Configuration
public virtual int AddProfileRule( StringBuffer name, string profile, string packageName, IList<string> classes )
Exception | Condition |
---|---|
ConfigException | - in case of error, when exceptions are enabled through the ErrorManager singleton. |
Creates a rule to automatically load the given profile when one of the specified activities comes to foreground.
The specified activities must all belong to the same package.
When the activity is no more in foreground the previous configuration is restored.
A rule is uniquely identified by its name which must therefore be unique. In input, through parameter name, you can specify the name to be associated with the rule.
If name is unique it is used, otherwise the method makes it unique adding it a suffix.
The caller can learn the string used to name the rule because the StringBuffer object name is updated.
The profile associated to the rule is the one found with the given name. There must be only one rule to be loaded when an activity comes to the foreground. If one of the specified activities already has an associated profile the method fails.