Example #1
0
        private void clearButton_Click(object sender, RoutedEventArgs e)
        {
            ApplicationViewModel viewModel = DataContext as ApplicationViewModel;

            viewModel.ClearResolvedConflicts();
        }
Example #2
0
 internal NewRuleView(ApplicationViewModel appViewModel)
     : this(appViewModel, null)
 {
 }
Example #3
0
        private void conflictsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBox list = sender as ListBox;
            ApplicationViewModel viewModel = DataContext as ApplicationViewModel;

            if (viewModel != null)
            {
                if (list.SelectedItems.Count > 0)
                {
                    var items = list.SelectedItems.Cast <ConflictRuleViewModel>();
                    var v     = items.GroupBy(x => x.ConflictType);
                    var v2    = items.GroupBy(x => x.MigrationSource);
                    if (v.Count() == 1 && v2.Count() == 1)
                    {
                        ConflictHelpProvider.SetHelpPath(this, Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName),
                                                                            @"Documentation\TfsIntegration.chm"));
                        ConflictHelpProvider.SetHelpKeyword(this, items.First().ConflictType);
                        string bestScope = FindBestScope(items);
                        if (bestScope != null)
                        {
                            viewModel.CurrentRule       = new ConflictRuleViewModel(items.First());
                            viewModel.CurrentRule.Scope = bestScope;
                            if (items.FirstOrDefault(x => x.IsResolved != ResolvedStatus.Resolved) == null)
                            {
                                viewModel.CurrentRule.IsResolved = ResolvedStatus.Resolved;
                                viewModel.ResetResolvableConflicts();
                            }
                            else
                            {
                                viewModel.CurrentRule.SetResolvableConflicts();
                            }
                        }
                        else
                        {
                            viewModel.CurrentRule = null;
                            viewModel.ResetResolvableConflicts();
                        }
                    }
                    else
                    {
                        viewModel.CurrentRule = null;
                        viewModel.ResetResolvableConflicts();
                    }
                }
                else
                {
                    viewModel.CurrentRule = null;
                    viewModel.ResetResolvableConflicts();
                }

                /*
                 * Selector listView = sender as Selector;
                 * if (listView != null)
                 * {
                 *  if (listView.SelectedItem != null)
                 *  {
                 *      ConflictRuleViewModel conflict = listView.SelectedItem as ConflictRuleViewModel;
                 *      Debug.Assert(conflict != null);
                 *      conflict.SetResolvableConflicts();
                 *  }
                 *  else
                 *  {
                 *      ApplicationViewModel viewModel = DataContext as ApplicationViewModel;
                 *      Debug.Assert(viewModel != null);
                 *      viewModel.ResetResolvableConflicts();
                 *  }
                 * }
                 * */
            }
        }