예제 #1
0
        private void resolveButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Button button = sender as Button;
                Debug.Assert(button != null);

                ExistingRuleViewModel rule = button.DataContext as ExistingRuleViewModel;
                if (rule != null)
                {
                    IEnumerable <ConflictResolutionResult> results = rule.SaveToDB();

                    if (results.Where(x => !x.Resolved).Count() > 0)
                    {
                        ResultsDialog resultsDialog = new ResultsDialog(results);
                        resultsDialog.Owner = Window.GetWindow(this);
                        resultsDialog.ShowDialog();
                    }
                }
            }
            catch (Exception exception)
            {
                Utilities.HandleException(exception);
            }
        }
예제 #2
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);
            }
        }