Archived

This forum has been archived. Please start a new discussion on GitHub.

Properties.load clarification and saving property sets

What happens if the properties set already contains some of the properties contained in the loaded file? With the same or different values?

Also, is there a simple way to save a property set (or its subset for some prefix) to a file?

Comments

  • bernard
    bernard Jupiter, FL
    Hi Alexey,
    What happens if the properties set already contains some of the properties contained in the loaded file? With the same or different values?

    If you set a property that was previously set, you override the existing value. This is true whether you set this property programmatically or by loading a configuration file.
    Also, is there a simple way to save a property set (or its subset for some prefix) to a file?

    You can use the getPropertiesForPrefix operation to transform your property set (Ice Properties) into a simple dictionary<string, string> and then persist this dictionary anyway you like (e.g. into a file or Freeze Map). Ice does not provide a public API to write Ice Properties to an Ice configuration file.

    Best regards,
    Bernard
  • Thank you for the answers!