Skip to main content
.NET Framework 4.5.2+

BoolList.Contains(String) Method

Indicates whether a particular key exists in the BoolList‘s collection of key/value pairs.

Namespace: DevExpress.ExpressApp.Utils

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public bool Contains(
    string key
)

Parameters

Name Type Description
key String

A string representing the key that will be checked for existence in the BoolList‘s collection of key/value pairs.

Returns

Type Description
Boolean

true, if the specified key exists in the BoolList‘s collection of key/value pairs; otherwise, false.

Remarks

You can use this method, prior to reading the value associated with a key, via the BoolList.Item indexer property, to check that a key/value pair exists for the key. The following code snippet illustrates this.

BoolList mylist = new BoolList();
//...
Boolean myValue = false;
if (mylist.Contains("myKey")) {
    myValue = mylist["myKey"];
}

To get all keys from the BoolList‘s collection of key/value pairs, use the BoolList.GetKeys method.

See Also