public void RemoveView(ViewPoint view, Markup issue, bool delComm) { if (File.Exists(Path.Combine(TempPath, issue.Topic.Guid, view.Viewpoint))) { File.Delete(Path.Combine(TempPath, issue.Topic.Guid, view.Viewpoint)); } if (File.Exists(view.SnapshotPath)) { File.Delete(view.SnapshotPath); } var guid = view.Guid; issue.Viewpoints.Remove(view); //remove comments associated with that view var viewcomments = issue.Comment.Where(x => x.Viewpoint != null && x.Viewpoint.Guid == guid).ToList(); if (!viewcomments.Any()) { return; } foreach (var viewcomm in viewcomments) { if (delComm) { issue.Comment.Remove(viewcomm); } else { viewcomm.Viewpoint = null; } } HasBeenSaved = false; }
public void RemoveComment(Comment comment, Markup issue) { issue.Comment.Remove(comment); HasBeenSaved = false; }