예제 #1
0
        static void UpdateCheckStateForSelection(
            PendingChangesTreeView treeView,
            ChangeTreeViewItem senderTreeViewItem)
        {
            IList <int> selectedIds = treeView.GetSelection();

            if (selectedIds.Count <= 1)
            {
                return;
            }

            if (!selectedIds.Contains(senderTreeViewItem.id))
            {
                return;
            }

            bool isChecked = senderTreeViewItem.ChangeInfo.IsChecked();

            foreach (TreeViewItem treeViewItem in treeView.FindRows(selectedIds))
            {
                if (treeViewItem is ChangeCategoryTreeViewItem)
                {
                    ((ChangeCategoryTreeViewItem)treeViewItem).Category
                    .UpdateCheckedState(isChecked);
                    continue;
                }

                ((ChangeTreeViewItem)treeViewItem).ChangeInfo
                .UpdateCheckedState(isChecked);
            }
        }
예제 #2
0
        internal static void SelectChanges(
            PendingChangesTreeView treeView,
            List <ChangeInfo> changesToSelect)
        {
            if (changesToSelect == null || changesToSelect.Count == 0)
            {
                treeView.SelectFirstPendingChangeOnTree();
                return;
            }

            treeView.SelectPreviouslySelectedPendingChanges(changesToSelect);

            if (treeView.GetSelection().Count > 0)
            {
                return;
            }

            treeView.SelectFirstPendingChangeOnTree();
        }