use “Points”. No need to do PointsCount.
How do I get hold of the Points in this case?
Public Class TransformDGMStroke
Inherits GoXmlTransformer
Public Sub New()
Me.TransformerType = GetType(DGMStroke)
Me.ElementName = "STROKE"
End Sub
Public Overrides Sub GenerateAttributes(ByVal obj As Object)
MyBase.GenerateAttributes(obj)
Dim c As DGMStroke = CType(obj, DGMStroke)
WriteAttrVal("Position", c.Position)
End Sub
Public Overrides Sub ConsumeAttributes(ByVal obj As Object)
MyBase.ConsumeAttributes(obj)
Dim c As DGMStroke = CType(obj, DGMStroke)
c.Position = PointFAttr("Position", New PointF(110, 110))
End Sub
t.AddBinding(“Points”)
Hi Jake,
MyBase.GenerateAttributes(obj)
Dim c As DGMStroke = CType(obj, DGMStroke)
WriteAttrVal("Position", c.Position)
WriteAttrVal("Points", c.Points)
End Sub
Right. “Points” is a special keyword handled by AddBinding and GoXmlBindingTransformer.
You’re using the lower level XML support here. Why did you switch? You started this note asking about AddBinding.
Try…
WriteAttrVal(“Points”, c.CopyPointsArray())
and you’ll need something like
((GoStroke)obj).SetPoints(PointFArrayAttr(attrname, null))
on the flip side, but it’s a lot easier to use the GoXmlBindingTransformers.
and you don’t need Position, that’s defined by the Points.
Thanks Jake - I am new with the GoXmlBindingTransformer saving and are looking into the options.
There’s a section in the User Guide on XML, and several samples that show GoXmlBindingTransformer. Plus, the Reference API class documentation has a lot of detail.