Esempio n. 1
0
 private void HandleMultipleNodesChanged(object sender, MultipleNodesChangedEventArgs e)
 {
     _rowRenderer.SizeColumnsToContent(e.AddedNodes, e.RemovedNodes, e.ChangedNodes);
     UpdateTopNode();
     UpdateScrollRange();
     InvalidateBelow(0);
 }
Esempio n. 2
0
        private void HandleMultipleNodesChanged(object sender, MultipleNodesChangedEventArgs e)
        {
            // ensure correct lock ordering - lock node collection before selection
            lock ( _nodeCollection )
            {
                lock ( SelectionLock )
                {
                    if (Count > 0)
                    {
                        if (_nodeCollection.IsEmpty)
                        {
                            Clear();
                        }
                        else
                        {
                            IViewNode[] selNodes = SelectionToArray();
                            foreach (IViewNode selNode in selNodes)
                            {
                                if (!_visibleNodeCollection.IsNodeVisible(selNode))
                                {
                                    UnselectNode(selNode);
                                }
                            }

                            if (Count == 0)
                            {
                                IVisibleNodeEnumerator enumerator = _visibleNodeCollection.GetFullEnumerator();
                                if (enumerator.MoveNext())
                                {
                                    SelectAndFocusNode(enumerator.CurrentNode);
                                }
                            }
                        }
                    }
                }
            }
        }