Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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