A class impementing Collection to store references to child DomElement of Collection.element, using an attribute in items as key or MappeableElement.get_map_key method if implemented by items to be added. If key is not defined in node, it is not added; but keeps it as a child node of actual Collection.element.
If GomElement to be added is of type Collection.items_type and implements MappeableElement, you should set GomHashMap.attribute_key to null in order to use returned value of MappeableElement.get_map_key as key.
public class YourObject : GomElement {
[Description (nick="::Name")]
public string name { get; set; }
}
public class YourList : GomHashMap {
construct {
try { initialize_with_key (typeof (YourObject),"Name"); }
catch (GLib.Error e) {
warning ("Initialization error for collection type: %s : %s"
.printf (get_type ().name(), e.message));
}
}
}