public PointF GetPoint(int index) { if (index < 0 || index > ControlPoints.Length) { throw ExceptionFactory.ArgumentOutOfRangeException("index"); } return(GetActualPointFromControlPoint(ControlPoints[index])); }
public void RemovePoint(int index) { if (index < 0 || index > ControlPoints.Length) { throw ExceptionFactory.ArgumentOutOfRangeException("index"); } var newArray = new PointF[ControlPoints.Length - 1]; Array.Copy(ControlPoints, newArray, index); Array.Copy(ControlPoints, index + 1, newArray, index, ControlPoints.Length - index - 1); ControlPoints = newArray; }
public void SetPoint(PointF point, int index) { if (index < 0 || index >= ControlPoints.Length) { throw ExceptionFactory.ArgumentOutOfRangeException("index"); } var actualPoints = new List <PointF>(GetPoints()); actualPoints[index] = point; ControlPoints = actualPoints.ToArray(); Transform = new Transform(); OnChanged(); }
public void InsertPoint(PointF point, int index) { if (index < 0 || index > ControlPoints.Length) { throw ExceptionFactory.ArgumentOutOfRangeException("index"); } var actualPoints = new List <PointF>(GetPoints()); actualPoints.Insert(index, point); // change original points to actual points and reset transform ControlPoints = actualPoints.ToArray(); // OnChanged() will be fired in Transform property Transform = new Transform(); }