Пример #1
0
 void model_SelectionUpdateEvt(Selection.State previous, Selection.State current)
 {
     if (current.run != previous.run)
     {
         ChangeRun(current.run);
     }
     if (current.SelectedEntity != previous.SelectedEntity)
     {
         ChangeInvocation(current.SelectedEntity);
     }
 }
Пример #2
0
 void model_SelectionUpdateEvt(Selection.State previous, Selection.State current)
 {
     if (previous.SelectedEntity != null && previous.SelectedEntity is ChessResultEntity)
     {
         rowmap[previous.chessResult.Label].DefaultCellStyle.BackColor = dataGridView1.DefaultCellStyle.BackColor;
     }
     if (current.sender != this)
     {
         if (current.run != previous.run)
         {
             SetRun(current.run);
         }
     }
     if (current.sender != this && current.SelectedEntity != null && current.SelectedEntity is ChessResultEntity)
     {
         rowmap[current.chessResult.Label].DefaultCellStyle.BackColor = SystemColors.ControlLight;
     }
 }
Пример #3
0
 void model_SelectionUpdated(Selection.State previous, Selection.State current)
 {
     suspend_selection_notify = true;
     if (current.sender != this && current.SelectedEntity != previous.SelectedEntity)
     {
         var visibleEntity = current.SelectedEntity == null ? null : current.SelectedEntity.GetVisibleAncestor();
         if (visibleEntity != null)
         {
             Debug.Assert(visibleEntity.GetValue(EntityTreeNodeProperty) != null, "TreeNode has not been set.");
             treeView1.SelectedNode = visibleEntity.GetValue(EntityTreeNodeProperty);
             if (treeView1.SelectedNode != null)
             {
                 treeView1.SelectedNode.EnsureVisible();
             }
         }
         else
         {
             treeView1.SelectedNode = null;
         }
     }
     suspend_selection_notify = false;
 }
Пример #4
0
        void model_SelectionUpdateEvt(Selection.State previous, Selection.State current)
        {
            if (suppress_selection_notify)
            {
                return;
            }

            suppress_selection_notify = true;
            try
            {
                // Reset the previously selected row's color
                foreach (var row in _selectedRows)
                {
                    row.DefaultCellStyle.BackColor = dataGridView1.DefaultCellStyle.BackColor;
                    row.Selected = false;
                }
                _selectedRows.Clear();

                // Set the selected row's color
                if (current.sender != this && current.run != null)
                {
                    int          taskID = current.run.TaskID;
                    BoundRunItem runItem;
                    if (_tasksByID.TryGetValue(taskID, out runItem))
                    {
                        var row = dataGridView1.Rows[_tasksBindingSource.Find("TaskID", taskID)];
                        row.DefaultCellStyle.BackColor = InactiveSelectionBackColor;
                        _selectedRows.Add(row);

                        // Unfortunately, there's no way to auto-scroll an arbitrary row into view.
                    }
                }
            }
            finally
            {
                suppress_selection_notify = false;
            }
        }
Пример #5
0
        void model_SelectionUpdateEvt(Selection.State previous, Selection.State current)
        {
            if (current.sender == this)
            {
                return;
            }

            TestResultTreeNode node = null;

            if (current.testResult != null)
            {
                node = current.testResult.DataElement.Annotation <TestResultTreeNode>();
                System.Diagnostics.Debug.Assert(node != null, "The node was selected before there was a test result. How's this possible? We have a race somewhere.");
            }

            suspend_selection_notify = true;
            treeView1.SelectedNode   = node;
            if (node != null)
            {
                node.EnsureVisible();
            }
            suspend_selection_notify = false;
        }
Пример #6
0
 // selection
 internal void SelectionUpdateNotify(Selection.State previous, Selection.State current)
 {
     SelectionUpdated(previous, current);
 }