GoDigram for .NET Framework and .NET Core
Northwoods.Go.Xml Namespace / GoXmlTransformer Class / Allocate Method
In This Topic
    Allocate Method (GoXmlTransformer)
    In This Topic
    Override this method to construct a new object for the current XML element.
    Syntax
    public virtual object Allocate()

    Return Value

    An object of type TransformerType, or null if no object needs to be created for the current element.
    Remarks
    This is called by GoXmlReader.ConsumeObject. By default this returns a new instance of TransformerType, if that property is not null and represents a class. This should be overridden to construct an object. The construction may need to use the values of some attributes on the current XML element in order to decide what to construct or which constructor to call. If this is called by a nested call to ConsumeObject within an implementation of ConsumeBody, then the ParentObject property will refer to the object for which the body is being consumed. The ParentObject can be used to find and return an existing child of the parent object, rather than constructing a new object as the child. Note that unlike the other implementations of IGoXmlTransformer methods, this method does not default to calling InvokeAllocate on the base Type, since that is unlikely to create an instance of the desired type.
    See Also