<object> : CookXml Core Tag
This tag can do three things:
- Reference an id object (same as
idref, but with "id:" prefix). - Reference a variable inside the variable object (same as
varref, but with "var:" prefix). - Construct an arbitrary object that has a default constructor with the name of the class as the value for the constructor attribute of the element.
Constructor Attribute ( ctor )
There are three formats:
| Format | Description |
|---|---|
id:name | Reference the object with id "name". |
var:name | Reference the object with variable "name". |
| className | Construct the object using the default constructor. |
Additional Notes
Usually one only uses this tag to construct a new object. It is easier to useidref and varref for the other two purposes.
Examples
In the following XML code, a new instance of foo.MyButton class is created usingobject tag. Then tag attribute is used to instruct CookXml to treat it as a button object. Lastly, set the object's text attribute to "OK".
<object ctor="foo.MyButton" tag="button" text="OK"/>
PDF
History


