internal ViewConflictDialog(ConflictRuleViewModel conflict) { m_conflict = conflict; InitializeComponent(); DataContext = m_conflict; }
internal IEnumerable <ConflictResolutionResult> ResolveConflict(ConflictRuleViewModel conflict) { IEnumerable <ConflictResolutionResult> results = conflict.Save(); RefreshFilteredConflicts(); return(results); }
private void btnResolve_Click(object sender, RoutedEventArgs e) { try { ApplicationViewModel viewModel = DataContext as ApplicationViewModel; Debug.Assert(viewModel != null); ConflictRuleViewModel conflict = viewModel.CurrentRule; if (conflict != null) { var results = viewModel.ResolveConflict(conflict); if (results.Where(x => !x.Resolved).Count() > 0) { ResultsDialog resultsDialog = new ResultsDialog(results); resultsDialog.Owner = Window.GetWindow(this); resultsDialog.ShowDialog(); } viewModel.ResetResolvableConflicts(); } } catch (Exception exception) { Utilities.HandleException(exception); } }
public void SetResolvedConflicts(IEnumerable <ConflictResolutionResult> results, int resolvedByRuleId) { foreach (ConflictResolutionResult result in results) { ConflictRuleViewModel conflict = m_allActiveConflicts.SingleOrDefault(x => x.ConflictInternalId == result.ConflictInternalId); if (conflict != null) { if (result.Resolved) { conflict.IsResolved = ResolvedStatus.Resolved; conflict.ResolvedByRuleId = resolvedByRuleId; } else { conflict.IsResolved = ResolvedStatus.Failed; } } } }
public static void DisplayExtendedInformation(FrameworkElement element) { if (element != null) { ConflictRuleViewModel conflict = element.DataContext as ConflictRuleViewModel; if (conflict != null) { try { ViewConflictDialog dialog = new ViewConflictDialog(conflict); dialog.Owner = Window.GetWindow(element); dialog.ShowDialog(); } catch (Exception exception) { Utilities.HandleException(exception); } } } }
public ConflictRuleViewModel(ConflictRuleViewModel copyFrom) : this(copyFrom.RTConflict, copyFrom.AppViewModel) { }
public void SetConflictRuleViewModel(ConflictRuleViewModel viewModel) { m_conflictRuleViewModel = viewModel; }