예제 #1
0
 private void Checkpoint()
 {
     this._canAddPoints = false;
     this._currentPoints.Clear();
     this.CurvesData.Add(CurveData.BuildFrom(this._currentCurveData));
     this._currentCurveData.Points.Clear();
     this._curves.Add(new Curve((IEnumerable <Path>)Enumerable.ToList <Path>(this._currentCurve)));
     this._currentCurve.Clear();
 }
예제 #2
0
        public static CurveData BuildFrom(CurveData data)
        {
            CurveData curveData = new CurveData();

            curveData.StrokeBrush     = data.StrokeBrush;
            curveData.StrokeThickness = data.StrokeThickness;
            curveData.Points.AddRange((IEnumerable <Point>)Enumerable.ToList <Point>(data.Points));
            return(curveData);
        }
예제 #3
0
        public Curve Undo()
        {
            Curve curve = (Curve)Enumerable.LastOrDefault <Curve>(this._curves);

            if (curve == null)
            {
                return(null);
            }
            CurveData curveData = (CurveData)Enumerable.LastOrDefault <CurveData>(this.CurvesData);

            if (curveData != null)
            {
                this.CurvesData.Remove(curveData);
            }
            this._curves.RemoveAt(this._curves.Count - 1);
            this.GraffitiCacheData.RemoveLastCurve();
            return(curve);
        }