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); }
public EventArgs(ControlPoint controlPoint) { ControlPoint = controlPoint; }
private void controlPoint_StateChanged(ControlPoint.EventArgs e) { OnControlPointStateChanged(e.ControlPoint); }
protected void OnRemoved(ControlPoint controlPoint) { List<ControlPoint> controlPoints = new List<ControlPoint>(); controlPoints.Add(controlPoint); if (Removed != null) Removed(new SplineClip.EventArgs(controlPoints)); }
protected void OnControlPointStateChanged(ControlPoint controlPoint) { List<ControlPoint> controlPoints = new List<ControlPoint>(); controlPoints.Add(controlPoint); if (ControlPointStateChanged != null) ControlPointStateChanged(new SplineClip.EventArgs(controlPoints)); }
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); } } } }
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); }