GoDigram for .NET Framework and .NET Core
Northwoods.Go.Xml Namespace / GoXmlBindingTransformer Class / HandlesChildren Property
In This Topic
    HandlesChildren Property
    In This Topic
    Gets or sets whether there are child objects of this Northwoods.Go.GoGroup that should be represented as nested XML elements in the body of this transformer's element.
    Syntax
    public bool HandlesChildren {get; set;}

    Property Value

    This defaults to false.
    Remarks

    If you are defining a transformer for a Northwoods.Go.GoSubGraphBase-inheriting class, you'll want to set this to true.

    Setting this to true also automatically sets BodyConsumesChildElements to true.

    You may find that nested elements are being generated for child objects for which you do not want separate XML elements. This may happen, for example, when you define a transformer for the Northwoods.Go.GoText class and for a node class that has a predefined label as well as a variable number of additional Northwoods.Go.GoText children. You have at least two choices.

    One choice is to replace all of those non-label Northwoods.Go.GoText child objects with instances of some class that inherits from Northwoods.Go.GoText. Because transformers are defined per type, this is an easy way to discriminate between the usages of text objects. Your transformer should then be defined for your custom class inheriting from Northwoods.Go.GoText, instead of for Northwoods.Go.GoText itself.

    The other choice is to make the transformer for Northwoods.Go.GoText smarter. Use a transformer inheriting from GoXmlBindingTransformer and override the GoXmlTransformer.SkipGeneration method to return true when the text object is actually a label handled as a node attribute, and to return false when the text object is supposed to be represented as a separate nested XML element.

    See Also