Esempio n. 1
0
 public void Add(ControlPoint controlPoint, int x, float y)
 {
     Deselect();
     controlPoint.X = x;
     controlPoint.Y = y;
     controlPoint.IsSelected = true;
     controlPoints.Add(controlPoint);
     controlPoint.StateChanged += controlPointStateChangedHandler;
     DestroyPreview();
     UpdateCoreClip();
     OnAdded(controlPoint);
 }
Esempio n. 2
0
 public EventArgs(ControlPoint controlPoint)
 {
     ControlPoint = controlPoint;
 }
Esempio n. 3
0
 private void controlPoint_StateChanged(ControlPoint.EventArgs e)
 {
     OnControlPointStateChanged(e.ControlPoint);
 }
Esempio n. 4
0
 protected void OnRemoved(ControlPoint controlPoint)
 {
     List<ControlPoint> controlPoints = new List<ControlPoint>();
     controlPoints.Add(controlPoint);
     if (Removed != null)
         Removed(new SplineClip.EventArgs(controlPoints));
 }
Esempio n. 5
0
 protected void OnControlPointStateChanged(ControlPoint controlPoint)
 {
     List<ControlPoint> controlPoints = new List<ControlPoint>();
     controlPoints.Add(controlPoint);
     if (ControlPointStateChanged != null)
         ControlPointStateChanged(new SplineClip.EventArgs(controlPoints));
 }
Esempio n. 6
0
        public override void FromXmlElement(XmlElement root)
        {
            PopulateClipWithBasicInformationFromXmlElement(root);

            foreach (XmlNode node in root.ChildNodes)
            {
                if (node.Name == "splinetype")
                {
                    int type = int.Parse(node.InnerText);
                    SetSplineType(type);
                }
                else if (node.Name == "controlpoints")
                {
                    foreach (XmlNode subnode in node.ChildNodes)
                    {
                        ControlPoint controlPoint = new ControlPoint();
                        controlPoint.FromXmlElement((XmlElement)subnode);
                        Add(controlPoint, controlPoint.X, controlPoint.Y);
                    }
                }
            }
        }
Esempio n. 7
0
 private Rectangle ControlPointDimensionToPixelDimension(ControlPoint point)
 {
     Point p = ControlPointPointToPixelPoint(point.X, point.Y);
     return new Rectangle(p.X - controlPointSize / 2, p.Y - controlPointSize / 2, controlPointSize + 1, controlPointSize + 1);
 }