private void RefreshFrames(List <ThreadStackFrame> frames)
        {
            int indexDelta = r_waitedNodes.Count + r_ownedNodes.Count;
            int countOld   = r_frameNodes.Count;
            int countNew   = frames.Count;
            int to         = countNew;

            if (countNew < countOld)
            {
                for (int i = countNew; i < countOld; ++i)
                {
                    r_frameNodes[countNew].Remove();
                    r_frameNodes.RemoveAt(countNew);
                }
            }
            else if (countOld < countNew)
            {
                to = countOld;
                int index = countOld;

                for (int i = 0; i < (countNew - countOld); ++i)
                {
                    ThreadStackFrame     frame     = frames[index];
                    ThreadStackFrameNode frameNode = new ThreadStackFrameNode(r_manager, r_threadStackNode, index + indexDelta, frame);
                    r_frameNodes.Add(frameNode);
                    ++index;
                }
            }

            for (int i = 0; i < to; ++i)
            {
                r_frameNodes[i].Refresh(frames[i]);
            }
        }
예제 #2
0
        private void RefreshFrames(List<ThreadStackFrame> frames)
        {
            int indexDelta = r_waitedNodes.Count + r_ownedNodes.Count;
            int countOld = r_frameNodes.Count;
            int countNew = frames.Count;
            int to = countNew;

            if (countNew < countOld)
            {
                for (int i = countNew; i < countOld; ++i)
                {
                    r_frameNodes[countNew].Remove();
                    r_frameNodes.RemoveAt(countNew);
                }
            }
            else if (countOld < countNew)
            {
                to = countOld;
                int index = countOld;

                for (int i = 0; i < (countNew - countOld); ++i)
                {
                    ThreadStackFrame frame = frames[index];
                    ThreadStackFrameNode frameNode = new ThreadStackFrameNode(r_manager, r_threadStackNode, index + indexDelta, frame);
                    r_frameNodes.Add(frameNode);
                    ++index;
                }
            }

            for (int i = 0; i < to; ++i)
            {
                r_frameNodes[i].Refresh(frames[i]);
            }
        }