Click or drag to resize

ProfileManagerAddProfileRule Method

Creates a rule to automatically load the given profile when one of the specified activities comes to foreground.

Namespace:  Com.Datalogic.Device.Configuration
Assembly:  datalogic-xamarin-sdk (in datalogic-xamarin-sdk.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public virtual int AddProfileRule(
	StringBuffer name,
	string profile,
	string packageName,
	IList<string> classes
)

Parameters

name
Type: StringBuffer
- StringBuffer in input an empty string or the preferred name for the rule, in output the unique name assigned to the rule; if the value in input is unique and not empty is the value used otherwise the method makes it unique adding a suffix.
profile
Type: SystemString
- String the name of the profile to be loaded when one of the given activities comes to foreground.
packageName
Type: SystemString
- String name of the package containing the given activities.
classes
Type: System.Collections.GenericIListString
- ArrayList list of class names inside of the package for which the profile must be loaded. If the list is empty it means all the classes of the package.

Return Value

Type: Int32
int Success in case of success, otherwise a possible error code, matching one of the ConfigException error constants.
Exceptions
ExceptionCondition
ConfigException - in case of error, when exceptions are enabled through the ErrorManager singleton.
Remarks

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.

[Android Documentation]

See Also