Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the <a href="http://docwiki.embarcadero.com/Libraries/en/System.Classes.TPersistent.DefineProperties"><code>DefineProperties</code></a> extension point to help migrate your .dfm files.</p> <pre><code>type TMyComponent = class(...) private procedure ReadPropName(Reader: TReader); protected procedure DefineProperties(Filer: TFiler); override; published property MyPropName: string read ... write ...; end; procedure TMyComponent.DefineProperties(Filer: TFiler); begin inherited; Filer.DefineProperty('PropName', ReadPropName, nil, False); end; procedure TMyComponent.ReadPropName(Reader: TReader); begin MyPropName := Reader.ReadString; end; </code></pre> <p>This will allow your new component to read in old .dfm files with the old property name. When the .dfm file is written again, the new property name will be used.</p> <p>Note that such a technique results in the component being able to read .dfm files containing either the old property name or the new property name so you can migrate in a gradual fashion if you wish. Once you have migrated all your .dfm files then it would be worth removing such code for the sake of tidiness.</p> <p>The Delphi documentation covers this subject area, albeit from a slightly different perspective, in the <a href="http://docwiki.embarcadero.com/RADStudio/en/Storing_and_Loading_Unpublished_Properties">Storing and Loading Unpublished Properties</a> section of the <a href="http://docwiki.embarcadero.com/RADStudio/en/Component_Writer%27s_Guide_Index">Component Writer's Guide</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload