TX Text Control .NET for Windows Forms

UserDefinedPropertyDictionary Class

Class|Introduced in 24.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Inherits
  1. DictionaryBase
  2. UserDefinedPropertyDictionary

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 : DictionaryBase

Examples

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;

Members

Constructors

ConstructorDescription
UserDefinedPropertyDictionaryInitializes a new instance of the UserDefinedPropertyDictionary class.

Properties

PropertyDescription
ItemGets 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.
NamesGets a collection of all property names the dictionary contains.
ValuesGets a collection of all property values the dictionary contains.

Methods

MethodDescription
AddAdds a new property to the dictionary.
ContainsDetermines whether the dictionary contains a property with the specified name.
RemoveRemoves a document property from the dictionary.