TX Text Control .NET for Windows Forms

Contains Method

Method|Introduced in 24.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Determines whether the dictionary contains a property with the specified name.

Syntax

public bool Contains(string name);

Parameters

ParameterDescription
name

Specifies a document property's name.

Examples

The following example checks for a review status before reading it.

UserDefinedPropertyDictionary properties = new();
properties.Add("ReviewStatus", "Approved");
properties.Add("Department", "Finance");
if (properties.Contains("ReviewStatus"))
{
    Console.WriteLine($"Review status: {properties["ReviewStatus"]}");
}