コード例 #1
0
        internal ViewConflictDialog(ConflictRuleViewModel conflict)
        {
            m_conflict = conflict;

            InitializeComponent();
            DataContext = m_conflict;
        }
コード例 #2
0
        internal IEnumerable <ConflictResolutionResult> ResolveConflict(ConflictRuleViewModel conflict)
        {
            IEnumerable <ConflictResolutionResult> results = conflict.Save();

            RefreshFilteredConflicts();
            return(results);
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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;
             }
         }
     }
 }
コード例 #5
0
 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);
             }
         }
     }
 }
コード例 #6
0
 public ConflictRuleViewModel(ConflictRuleViewModel copyFrom)
     : this(copyFrom.RTConflict, copyFrom.AppViewModel)
 {
 }
コード例 #7
0
 public void SetConflictRuleViewModel(ConflictRuleViewModel viewModel)
 {
     m_conflictRuleViewModel = viewModel;
 }