please use a CDynamicObjectArray for the layers and connections and rename Connection to CConnection to get it serialized