Esempio n. 1
0
 /// <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));
     }
 }
Esempio n. 2
0
 /// <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));
     }
 }
Esempio n. 3
0
 /// <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();
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Deletes the issue.
 /// </summary>
 /// <param name="issue">The issue.</param>
 public void DeleteIssue(Issue issue)
 {
     _documentRepository.DeleteIssue(issue);
     UpdateLinks();
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 /// <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;
 }
Esempio n. 7
0
 /// <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();
 }