# UserDefinedPropertyDictionary.Contains Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > UserDefinedPropertyDictionary.Contains Method
- **564 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/userdefinedpropertydictionary/contains-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/userdefinedpropertydictionary/contains-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/userdefinedpropertydictionary/contains-method/llms-full.txt

---

### Description

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

### Syntax

```csharp
public bool Contains(string name);
```

```vbnet
Public Function Contains(name As String) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| name | Specifies a document property's name. |

### Examples

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

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

```vbnet
Dim properties As New UserDefinedPropertyDictionary()
properties.Add("ReviewStatus", "Approved")
properties.Add("Department", "Finance")
If properties.Contains("ReviewStatus") Then
    Console.WriteLine($"Review status: {properties.Item("ReviewStatus")}")
End If
```

---

## Nearby

- **Previous:** [UserDefinedPropertyDictionary Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/userdefinedpropertydictionary/constructor/llms-full.txt)
- **Next:** [UserDefinedPropertyDictionary.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/userdefinedpropertydictionary/item-property/llms-full.txt)
