Just wondered if anyone had tried adding their own attributes to a TxRobot?
I'd like to make use of the Attributes of a TxRobot. Have tried a number of variations on the following (string attributes etc):
TxAttribute a = new TxNoValueAttribute("MyAttribute"); Robot.Attributes.Add(a);
The Attributes list is not read-only, and no error is raised, but when watching the value of the robot's attributes, nothing is added by these lines. Seems like the Set method does nothing.
To give a bit of context, I'm trying to store some markers representing aspects of the robot (e.g. what processes it's carrying out). I'd like to store it with the robot itself, rather than having to create a separate file (e.g. xml) and matching up robots with their attributes, which seems clumsy. If there is a better way than (ab)using the attributes, I'd be interested.
The design of the API is such that when you call Robot.Attributes, each time it constructs and returns a new ArrayList. Modifying that list will not affect the robot.