Пример #1
0
    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);
        }
    }
Пример #2
0
    void ImportPoints(XmlElement parent, EnvelopePoints points)
    {
        XmlElement elt = parent["Points"];

        if (null == elt)
        {
            return;
        }
        foreach (XmlElement child in elt)
        {
            ImportPoint(child, points);
        }
    }
Пример #3
0
    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;
        }
    }