UserDefinedPropertyDictionary Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WinForms. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WinForms. SDK TXTextControl.from the setup.dll
- Inherits
- Dictionary
Base - User
Defined Property Dictionary
- Dictionary
Description
An instance of the UserDefinedPropertyDictionary class contains all user-defined document properties contained in a loaded document or which will be saved in a document. The UserDefinedPropertyDictionary class is used with the LoadSettings.UserDefinedDocumentProperties and SaveSettings.UserDefinedDocumentProperties properties. Each entry in the dictionary is a key/value pair, where the key is the name of the document property and the value is the document property's value. The foreach statement of the C# language (for each in Visual Basic) returns an object of the type of the elements in the collection. Since each element is a key/value pair, the element type is System.Collections.DictionaryEntry. The name must be of the type System.String and is limited to 255 characters. The value can be of the type System.String, System.Boolean, System.Int32 or System.Double.
Syntax
public class UserDefinedPropertyDictionary : DictionaryBasePublic Class UserDefinedPropertyDictionary
Inherits DictionaryBaseExamples
The following example creates a property dictionary and assigns it to the document settings.
UserDefinedPropertyDictionary properties = new();
properties.Add("ReviewStatus", "Approved");
properties.Add("Department", "Finance");
textControl.DocumentSettings.UserDefinedDocumentProperties = properties;Dim properties As New UserDefinedPropertyDictionary()
properties.Add("ReviewStatus", "Approved")
properties.Add("Department", "Finance")
textControl.DocumentSettings.UserDefinedDocumentProperties = propertiesMembers
Constructors
| Constructor | Description |
|---|---|
| UserDefinedPropertyDictionary | Initializes a new instance of the UserDefinedPropertyDictionary class. |
Properties
| Property | Description |
|---|---|
| Item | Gets a document property from the dictionary. In C# this property is the indexer for the UserDefinedPropertyDictionary class. The property returns an object of the type System.String, System.Boolean, System.Int32 or System.Double which is the value associated with the specified name. |
| Names | Gets a collection of all property names the dictionary contains. |
| Values | Gets a collection of all property values the dictionary contains. |