RAD Studio (Common)
ContentsIndex
PreviousUpNext
Setting Dynamic Properties

Many of the .NET Framework objects support dynamic properties. Dynamic properties provide a way to change property values without recompiling an application. The dynamic properties and their values are stored in a configuration file, along with the application's executable file. Changing a property value in the configuration file causes the change to take effect the next time the applications runs. Dynamic properties are useful for changing an application after it has been deployed.

To set a dynamic property in the Object Inspector

  1. In a form on the Design tab, click the object for which you want to set dynamic properties.
  2. In the Object Inspector, expand (DynamicProperties) and click (Advanced). If the object does not support dynamic properties, (DynamicProperties) is not displayed.
    Tip: If the Object Inspector
    is arranged by category, (DynamicProperties) is displayed under Configurations.
  3. Click the ellipsis (...) button next to (Advanced) to display the Dynamic Properties dialog box. This dialog lists all of the properties that can be stored in the configuration file.
  4. Select the properties you want to store in the configuration file.
  5. Optionally, you can override the default key name listed in the Key mapping field.
  6. Click OK. The dynamic properties are marked with an icon in the Object Inspector. RAD Studio creates an XML file named app.config (for a Windows application) or Web.config (for a Web application) in the project directory. This file lists the dynamic properties and their current values.
  7. Compile the application. RAD Studio creates a file named <projectname>.exe.config (for a Windows application) or <projectname>.dll.config (for a Web application) in the same directory as the application's executable or DLL file.

To change a dynamic property value in the configuration file

  1. In the directory that contains the application's executable or DLL file, locate the configuration file.
  2. Open the file in a text editor.
  3. Locate the add key= statement for the property to be changed and edit the value.
  4. Save your changes and close the file.
The next time the application runs, the changed property value will be in effect.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!