Save settings in project

I am developing an .NET Addon, but want to save some settings/configuration/userinput from the addon in the project file.
Can someone give an indication how to achieve this?
Thanks is advance,

You mean inside a .vcmx layout file?

A very general-purpose way is to create a ILayoutPropertyList from ISimWorld, and add properties to it. A string-type IProperty can hold any serialized data.

IApplication has LayoutSaving event where you can create / update your layout item content before the vcmx file gets written.

Component files don’t have layout items, so there you will need to create a (hidden) property in the ISimComponent, or a e.g. note behavior.

Thank you for the quick response.
Indeed in the vcmx file.

Inside a component node is indeed an option.
I was trying with [DataContract]/[DataMember] attributes, but that seems not to work.

VC doesn’t do any serialization of custom objects for you. You need to write the code to serialize your objects to a System.String, which you can then assign to string-type IProperty.Value. Similarly for loading you need to deserialize from a string.

The upside is that you can use any type of serialization you wish such as JSON, XML, base64-encoded binary etc.

Another option for fairly simple data is to create multiple IProperties, each containing some value such as integer, bool, string. With those you don’t need to have your own serialization, but will need to create and get the IProperties set / read their values etc.