Storing and Loading Unpublished Properties

From RAD Studio
Jump to: navigation, search

Go Up to Storing and Loading Properties

By default, only published properties are loaded and saved with a component. However, it is possible to load and save unpublished properties. This allows you to have persistent properties that do not appear in the Object Inspector. It also allows components to store and load property values that Delphi does not know how to read or write because the value of the property is too complex. For example, the TStrings object can't rely on Delphi's automatic behavior to store and load the strings it represents and must use the following mechanism.

You can save unpublished properties by adding code that tells Delphi how to load and save your property's value.

To write your own code to load and save properties, use the following steps:

  1. Creating Methods to Store and Load Property Values.
  2. Overriding the DefineProperties Method, passing those methods to a filer object.