Northwoods.GoWeb.Xml Assembly > Northwoods.GoWeb.Xml Namespace > GoXmlBindingTransformer Class > AddBinding Method : AddBinding(String,String,GoXmlBindingFlags) Method |
See AddBinding(String,String) for examples.
This override also allow you to specify that this attribute, during consumption, defines the identifier by which a reference object may be referred to. The referred-to object is typically a child Northwoods.GoWeb.GoObject of a Northwoods.GoWeb.GoGroup. For example, if you add a Northwoods.GoWeb.GoPort to your custom Northwoods.GoWeb.GoNode class, but do not want to have a separate XML element defining and describing that port, you will still need to generate the identifier for that port so that links will be able to find that port. If your node class defines a property that refers to your extra port, you can call this method to make sure the identifier is written for the port and that reading this attribute will make sure that node's port is given that identifier. transformer.AddBinding("xport", "SpecialPort", GoXmlBindingFlags.DefinesShared)
The order in which bindings are added determines the order in which properties are set when the attributes are consumed. Since setting some properties, such as the text string for a label, may modify the position or the location of a node, you should add the binding for a node's position or location last.
Setting the HandlesNamedPorts property is similar to defining a shared attribute property path for each of the ports on a node that has a name, as returned by FindName.
As special cases, there are two property names that provide special behavior. For the Northwoods.GoWeb.GoStroke, Northwoods.GoWeb.GoLabeledLink, Northwoods.GoWeb.GoPolygon, and Northwoods.GoWeb.GoDrawing classes, you can bind to the "Points" property in order to get or set the array of points used to define those shapes. The "Points" property is not treated specially for objects of any other type.
Also as a special case for node classes, the "TreeParentNode" property binding is handled as a reference to another node, where the other node is considered to be the "parent" node in a tree-structured diagram. This supports the definition of XML that only has elements for nodes, with an implicit link from a "parent" node to the node whose element includes the attribute corresponding to the "TreeParentNode" property. The TreeLinkPrototype property of this transformer provides a link that is copied when consuming such an element. The "TreeParentNode" property is not treated specially for objects that are not instances of IGoNode
.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2