GoDigram for .NET Framework and .NET Core
Northwoods.Go.Xml Namespace / GoXmlBindingTransformer Class / ConsumeChild Method
In This Topic
    ConsumeChild Method (GoXmlBindingTransformer)
    In This Topic
    This handles nested XML elements when HandlesChildren or TreeStructured are true.
    Syntax
    public override void ConsumeChild( 
       object parent,
       object child
    )

    Parameters

    parent
    child
    Remarks

    When HandlesChildren or GoXmlTransformer.GeneratesPortsAsChildElements is true, and when the parent is a Northwoods.Go.GoGroup and the child is a Northwoods.Go.GoObject, this will add the child object to the group.

    To support some flexibility to allow the Northwoods.Go.GoGroup be a property of the parent object instead of requiring the parent to be the Northwoods.Go.GoGroup itself, the child Northwoods.Go.GoObject is added to the parent's ChildrenCollectionPath property, if that value is a Northwoods.Go.GoGroup.

    When TreeStructured is true the XML element in the body produces a separate node that is connected by a link to this node. Both the parent and the child are assumed to implement Northwoods.Go.IGoNode. This method makes a copy of TreeLinkPrototype. It finds the port that is the TreeParentNodePortPath property on the parent node, and it finds the port that is the TreeChildNodePortPath property on the child node. Then it sets the Northwoods.Go.IGoLink.Northwoods.Go.IGoLink.FromPort and Northwoods.Go.IGoLink.ToPort properties of the new link to those ports. If TreeLinksToChildren is true, the Northwoods.Go.IGoLink.FromPort is assigned the parent's port, and the Northwoods.Go.IGoLink.ToPort is assigned the child's port. If TreeLinksToChildren is false, the ports are exchanged so that the link goes in the opposite direction. The child node and the link are then added to the GoXmlReader.GoXmlReader.RootObject.

    See Also