protected virtual void OnWorkItemIssuesOccurred(WorkItemIssueEventArgs args) { if ((WorkItemIssuesOccurred != null) && (args != null)) { WorkItemIssuesOccurred(this, args); } }
public void SaveChanges() { var args = new WorkItemIssueEventArgs(); foreach (var item in BacklogChildren) { if (item.Backlog.IsDirty) { var validationErrors = item.Backlog.Validate(); if (validationErrors.Count > 0) { args.WorkItemIssues.Add(new WorkItemIssue { WorkItem = item.Backlog }); } else { try { item.Backlog.Save(); } catch (Exception ex) { Logger.LogException(ex); args.WorkItemIssues.Add(new WorkItemIssue { WorkItem = item.Backlog }); } } } foreach (var workItem in item.Children) { if (workItem.IsDirty) { var validationErrors = workItem.Validate(); if (validationErrors.Count > 0) { args.WorkItemIssues.Add(new WorkItemIssue { WorkItem = workItem }); } else { try { workItem.Save(); } catch (Exception ex) { Logger.LogException(ex); args.WorkItemIssues.Add(new WorkItemIssue { WorkItem = workItem }); } } } } } OnWorkItemIssuesOccurred(args); }
private void OnWorkItemIssues(WorkItemIssueEventArgs e) { if (WorkItemIssues != null) { WorkItemIssues(this, e); } }
private void HandlWorkItemIssuesOccurred(object sender, WorkItemIssueEventArgs e) { if (e.WorkItemIssues.Count > 0) { OnWorkItemIssues(e); } }
private void HandleWorkItemIssues(object sender, WorkItemIssueEventArgs e) { if (!Dispatcher.CheckAccess()) { Dispatcher.Invoke(new Action <object, WorkItemIssueEventArgs>(HandleWorkItemIssues), sender, e); return; } var model = new WorkItemIssueViewModel(e.WorkItemIssues); var issueWindow = new WorkItemIssueWindow { Model = model, ApplicationViewModel = ViewModel, TaskboardControl = taskboardContent.taskboardControl, Owner = this, DataContext = model }; issueWindow.ShowDialog(); }