public bool Undo() { try { if (MLinePaths.Count > 0) { var last = MLinePaths.LastOrDefault(); if (last != null) { var lastLinePaths = MLinePaths.LastOrDefault(); if (lastLinePaths != null) { MRedoLinePaths.Add(lastLinePaths); } MLinePaths.Remove(last); } Invalidate(); } MBrushViewChangeListener?.OnViewRemoved(this); return(MLinePaths?.Count != 0); } catch (Exception e) { Console.WriteLine(e); return(false); } }
public bool Undo() { try { if (MDrawnPaths.Count > 0) { var last = MDrawnPaths.LastOrDefault(); if (last != null) { var lastLinePaths = MDrawnPaths.LastOrDefault(); if (lastLinePaths != null) { MRedoPaths.Add(lastLinePaths); } MDrawnPaths.Remove(last); } Invalidate(); } MBrushViewChangeListener?.OnViewRemoved(this); return(MDrawnPaths?.Count != 0); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(false); } }