Example #1
0
        private void HandleVisibleNodeAdded(object sender, JetListViewNodeEventArgs e)
        {
            Guard.NullArgument(e.Node, "e.Node");
            if (_topNode == null)    // first node added to the view
            {
                _topNode = e.Node;
            }
            UpdateScrollRange();

            IViewNode topNode = _topNode;

            if (topNode == null)
            {
                topNode = e.Node;
            }
            if (_visibleNodeCollection.GetMoveDirection(e.Node, topNode) == MoveDirection.Down)
            {
                // If we were scrolled so that the top item in the list was visible,
                // add the new item to the visible area. If the top item in the list was
                // not visible, scroll down so that the visible area remains the same and
                // the new item does not appear in it.
                if (_scrollOffset == 0)
                {
                    UpdateTopNode();
                }
                else
                {
                    OnRequestVerticalScroll(_scrollOffset + GetRowHeight(e.Node));
                }
            }
            InvalidateBelow(e.Node);
        }
Example #2
0
 private void HandleNodeChanged(object sender, JetListViewNodeEventArgs e)
 {
     if (e.Node.Level == 0)
     {
         GroupHeaderNode groupHeader = GetNodeGroupHeader(e.Node);
         int             headerIndex = _groupMap.IndexOfValue(groupHeader);
         if (headerIndex > 0)
         {
             GroupHeaderNode prevGroup = (GroupHeaderNode)_groupMap.GetByIndex(headerIndex - 1);
             if (prevGroup.TopNode == e.Node)
             {
                 RemoveGroup(prevGroup);
                 return;
             }
         }
         if (headerIndex < _groupMap.Count - 1)
         {
             GroupHeaderNode nextGroup = (GroupHeaderNode)_groupMap.GetByIndex(headerIndex + 1);
             if (nextGroup.TopNode == e.Node)
             {
                 RemoveGroup(nextGroup);
                 return;
             }
         }
     }
 }
Example #3
0
 private void HandleVisibleNodeRemoved(object sender, JetListViewNodeEventArgs e)
 {
     UpdateTopNode();
     UpdateScrollRange();
     if (_lastRemovedNodeTop >= 0)
     {
         InvalidateBelow(_lastRemovedNodeTop);
     }
 }
Example #4
0
        internal void OnNodeMoved(JetListViewNode node)
        {
            _version++;
            JetListViewNodeEventArgs args = new JetListViewNodeEventArgs(node);

            if (NodeMoved != null)
            {
                NodeMoved(this, args);
            }
        }
Example #5
0
        private void HandleNodeMoved(object sender, JetListViewNodeEventArgs e)
        {
            UpdateTopNode();
            int movedNodeTop = GetNodeTop(e.Node);

            if (_lastMovingNodeTop >= 0 || movedNodeTop >= 0)
            {
                InvalidateBelow(Math.Min(_lastMovingNodeTop, movedNodeTop));
            }
        }
Example #6
0
 private void HandleNodeExpandChanged(object sender, JetListViewNodeEventArgs e)
 {
     if (e.Node.Expanded)
     {
         _rowRenderer.ProcessNodeExpanded(e.Node);
     }
     else
     {
         _rowRenderer.ProcessNodeCollapsed(e.Node);
     }
     UpdateTopNode();
     UpdateScrollRange();
     InvalidateBelow(e.Node);
 }
Example #7
0
 private void HandleStructureChanged(object sender, JetListViewNodeEventArgs e)
 {
     Owner.OwnerControl.Invalidate();
 }
Example #8
0
 private void HandleNodeMoving(object sender, JetListViewNodeEventArgs e)
 {
     ProcessViewNodeRemoving(e.Node);
 }
Example #9
0
 private void HandleNodeChanged(object sender, JetListViewNodeEventArgs e)
 {
     InvalidateRow(e.Node);
 }
Example #10
0
 private void HandleNodeMoving(object sender, JetListViewNodeEventArgs e)
 {
     _lastMovingNodeTop = GetNodeTop(e.Node);
 }
Example #11
0
 private void HandleVisibleNodeRemoving(object sender, JetListViewNodeEventArgs e)
 {
     _lastRemovedNodeTop = GetNodeTop(e.Node);
 }
Example #12
0
 private void HandleNodeChanged(object sender, JetListViewNodeEventArgs e)
 {
     RecalcColumnWidth(RecalcOnNodeChanged, e.Node);
 }
Example #13
0
 private void HandleNodeRemoved(object sender, JetListViewNodeEventArgs e)
 {
     RecalcColumnWidth(RecalcAll, e.Node);
 }
Example #14
0
 private void HandleNodeAdded(object sender, JetListViewNodeEventArgs e)
 {
     ProcessNodeAdded(e.Node);
 }