RAD Studio |  |

Using the IsPropertyInCategory Function

An application can query the existing registered properties to determine whether a given property is already registered in a specified category. This can be especially useful in situations like a localization utility that checks the categorization of properties preparatory to performing its localization operations. Two overloaded variations of the IsPropertyInCategory function are available, allowing for different criteria in determining whether a property is in a category.

The first variation lets you base the comparison criteria on a combination of the class type of the owning component and the property's name. In the command line below, for IsPropertyInCategory to return True, the property must belong to a TCustomEdit descendant, have the name "Text," and be in the property category 'Localizable'.

Copy Code

    IsItThere := IsPropertyInCategory('Localizable', TCustomEdit, 'Text');

Copy Code

    IsItThere = IsPropertyInCategory("Localizable", __classid(TCustomEdit), "Text");

The second variation lets you base the comparison criteria on a combination of the class name of the owning component and the property's name. In the command line below, for IsPropertyInCategory to return True, the property must be a TCustomEdit descendant, have the name "Text", and be in the property category 'Localizable'.

Copy Code

    IsItThere := IsPropertyInCategory('Localizable', 'TCustomEdit', 'Text');

Copy Code

    IsItThere = IsPropertyInCategory("Localizable", "TCustomEdit", "Text");

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!