public bool Redo() { try { if (MRedoLinePaths.Count > 0) { var last = MRedoLinePaths.LastOrDefault(); if (last != null) { var lastLinePaths = MRedoLinePaths.LastOrDefault(); if (lastLinePaths != null) { MLinePaths.Add(lastLinePaths); } MRedoLinePaths.Remove(last); } Invalidate(); } MBrushViewChangeListener?.OnViewAdd(this); return(MRedoLinePaths.Count != 0); } catch (Exception e) { Console.WriteLine(e); return(false); } }
public bool Redo() { try { if (MRedoPaths.Count > 0) { var last = MRedoPaths.LastOrDefault(); if (last != null) { var lastLinePaths = MRedoPaths.LastOrDefault(); if (lastLinePaths != null) { MDrawnPaths.Add(lastLinePaths); } MRedoPaths.Remove(last); } Invalidate(); } MBrushViewChangeListener?.OnViewAdd(this); return(MRedoPaths.Count != 0); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(false); } }
public void TouchUp() { try { MPath.LineTo(MTouchX, MTouchY); // Commit the path to our offscreen MDrawCanvas.DrawPath(MPath, MDrawPaint); // kill this so we don't double draw MLinePaths.Add(new LinePath(MPath, MDrawPaint)); MPath = new Path(); if (MBrushViewChangeListener != null) { MBrushViewChangeListener.OnStopDrawing(); MBrushViewChangeListener.OnViewAdd(this); } } catch (Exception e) { Console.WriteLine(e); } }