/// <summary> /// Sets the issue. /// </summary> /// <param name="issue">The issue.</param> public void SetIssue(Issue issue) { _issue = issue; FromIssue(); FromAttachments(); ParentIssues.Clear(); foreach (Issue parent in Board.GetParents(issue.Id)) { ParentIssues.Add(new IssueViewModel(this, parent)); } }
/// <summary> /// Sets the issue. /// </summary> /// <param name="issue">The issue.</param> public void SetIssue(Issue issue) { _issue = issue; FromIssue(); FromAttachments(); ParentsViewModel.RelationIssues.Clear(); foreach (Issue parent in Board.GetParents(issue.Id)) { ParentsViewModel.RelationIssues.Add(new IssueViewModel(ParentsViewModel, parent)); } ChildrenViewModel.RelationIssues.Clear(); foreach (Issue child in Board.GetChildren(issue.Id)) { ChildrenViewModel.RelationIssues.Add(new IssueViewModel(ChildrenViewModel, child)); } }
/// <summary> /// Deletes the specified issue. /// </summary> /// <param name="issue">The issue.</param> public void Delete(Issue issue) { _board.DeleteIssue(issue); _board.Submit(); if (Current == Issues) { Issues.AsyncSearch(); } if (Current == ShowIssue) { ShowIssue.UpdateChildren(); } }
/// <summary> /// Deletes the issue. /// </summary> /// <param name="issue">The issue.</param> public void DeleteIssue(Issue issue) { _documentRepository.DeleteIssue(issue); UpdateLinks(); }
private bool HasDeadline(Issue issue, bool isActual) { if (isActual) { DateTime date; if (!DateTime.TryParse(issue.Deadline, out date)) { date = DateTime.MinValue; } return date > DateTime.Now; } return !String.IsNullOrWhiteSpace(issue.Deadline); }
/// <summary> /// Initializes a new instance of the <see cref="IssueViewModel" /> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="issue">The issue.</param> public IssueViewModel(object parent, Issue issue) { _parent = parent; _issue = issue; }
/// <summary> /// Sets the issue. /// </summary> /// <param name="issue">The issue.</param> public void SetIssue(IssueViewModel issue) { _issueModel = issue; _issue = issue.Model; Attachments.Clear(); foreach (string attachment in _board.GetAttachments(_issue.Id)) { Attachments.Add(new AttachmentViewModel(this) {FileName = attachment}); } Links.Clear(); foreach (var link in _issue.Links) { Links.Add(new LinkViewModel(this){ LinkName = link}); } UpdateParents(); UpdateChildren(); UpdateSource(); }