void ExportEnvelopePoints(XmlElement parent, EnvelopePoints points) { XmlElement elt = AddChild(parent, "Points"); elt.SetAttribute("Count", points.Count.ToString(myNumberFormat)); foreach (EnvelopePoint point in points) { ExportEnvelopePoint(elt, point); } }
void ImportPoints(XmlElement parent, EnvelopePoints points) { XmlElement elt = parent["Points"]; if (null == elt) { return; } foreach (XmlElement child in elt) { ImportPoint(child, points); } }
void ImportPoint(XmlElement elt, EnvelopePoints points) { Timecode x = AttributeTimecode(elt, "X"); Double y = AttributeDouble(elt, "Y"); CurveType curve = AttributeCurveType(elt, "Curve"); EnvelopePoint point = points.GetPointAtX(x); if (null == point) { point = new EnvelopePoint(x, y, curve); points.Add(point); } else { point.Y = y; point.Curve = curve; } }