The BoolList class represents a wrapper over a dictionary of string key/Boolean value pairs. A string key names the associated Boolean value. Based on the Boolean values, the BoolList determines the resulting value and exposes it via the BoolList.ResultValue property. The resulting value is determined, either by logically multiplying or logically summing the values from the BoolList's collection of key/value pairs. You can specify how the resulting value is determined by specifying the BoolListOperatorTypeoperatorType parameter when instantiating a BoolList via its BoolList constructor.
XAF uses BoolLists to provide conditional activation and deactivation of particular features. Consider the following example. Each Action has the ActionBase.Active property. This property exposes a BoolList, working in the BoolListOperatorType.And mode. When you specify an Action's Target... properties, such as ActionBase.TargetObjectType, a corresponding key is created in the Action's ActiveBoolList. Suppose that you have an Action whose ActionBase.TargetObjectType is set to Person. In this instance, the Action's ActiveBoolList can look like this:
Key="Controller active" Value="True"
The first key's value specifies that the Action's Controller is active, and so the Action can also be active. The second key's value specifies that the current View is not of the Person type, so the Action cannot be active. The resulting value of the ActiveBoolList is determined by logically multiplying the values from the BoolList, which in this example yields false. So, the sample Action will not be activated.
The BoolList class overrides the BoolList.Equals method. This allows you to use instances of the BoolList class in Boolean expressions, and compare such instances directly to Boolean values. The following code snippet illustrates this.