Example #1
0
        protected IEnumerator <object> FinishShowingTooltip(
            Point mouseLocation,
            HeapSnapshot.Heap heap,
            HeapSnapshot.Allocation allocation,
            HeapSnapshot.Traceback rawTraceback
            )
        {
            var uniqueRawFrames = rawTraceback.Frames.AsEnumerable().Distinct();

            var fSymbols = Instance.Database.SymbolCache.Select(uniqueRawFrames);

            using (fSymbols)
                yield return(fSymbols);

            var symbolDict = SequenceUtils.ToDictionary(
                uniqueRawFrames, fSymbols.Result
                );

            var tracebackInfo = HeapRecording.ConstructTracebackInfo(
                rawTraceback.ID, rawTraceback.Frames, symbolDict
                );

            var renderParams = new DeltaInfo.RenderParams {
                BackgroundBrush = new SolidBrush(SystemColors.Info),
                BackgroundColor = SystemColors.Info,
                TextBrush       = new SolidBrush(SystemColors.InfoText),
                IsExpanded      = true,
                IsSelected      = false,
                Font            = Font,
                ShadeBrush      = new SolidBrush(Color.FromArgb(31, 0, 0, 0)),
                StringFormat    = CustomTooltip.GetDefaultStringFormat()
            };

            var content = new HeapSnapshot.AllocationTooltipContent(
                ref allocation, ref tracebackInfo, ref renderParams
                )
            {
                Location = mouseLocation,
                Font     = Font
            };

            using (var g = CreateGraphics())
                CustomTooltip.FitContentOnScreen(
                    g, content,
                    ref content.RenderParams.Font,
                    ref content.Location, ref content.Size
                    );

            Tooltip.SetContent(content);
        }