Example #1
0
        private void DoRemove( NodeAndSubRect nodeAndSubRect )
        {
            CountAndSubRect countAndSubRect;

            if( _nodeCounts.TryGetValue( nodeAndSubRect.TreeNode, out countAndSubRect ) )
            {
                --countAndSubRect.Count;

                if( countAndSubRect.Count <= 0 )
                {
                    _nodeCounts.Remove( nodeAndSubRect.TreeNode );
                }
            }

            UpdateTimer();
        }
Example #2
0
        private void DoAdd( NodeAndSubRect nodeAndSubRect )
        {
            CountAndSubRect countAndSubRect;

            if( !_nodeCounts.TryGetValue( nodeAndSubRect.TreeNode, out countAndSubRect ) )
            {
                countAndSubRect = new CountAndSubRect();
                countAndSubRect.SubRect = nodeAndSubRect.SubRect;

                _nodeCounts[nodeAndSubRect.TreeNode] = countAndSubRect;
            }

            ++countAndSubRect.Count;

            countAndSubRect.SubRect = Rectangle.Union( countAndSubRect.SubRect, nodeAndSubRect.SubRect );

            UpdateTimer();
        }