Defines data the writer object writes as if the data were a property.
DefineProperty is called internally by the DefineProperties method of an object that has data it needs to store. DefineProperties takes a generic filer object as its parameter. For writing data, DefineProperties takes a TWriter object and calls its DefineProperty method. DefineProperty then writes the property's name and its data, but only if the HasData parameter is true. Otherwise it does nothing.
The Name parameter specifies the name of the "fake" property to be written to the stream.
The WriteData parameter points to a procedure (defined in the component object) that writes the object's data, which represents a property value, to the writer object. For TWriter the ReadData parameter is ignored.
The HasData parameter determines at run time whether the "fake" property has data to store (write). Thus, writer objects only use HasData when writing data.
When writing a component that has special (large) data storage requirements, the component's DefineProperties can be overridden. For each special or "fake" property item, call DefineProperty or DefineBinaryProperty. For the ReadData and WriteData parameters, pass in methods of the component that know how to handle that special data type. When reading, ReadData is called. When writing, WriteData is called.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!