Example #1
0
        /// <summary>
        /// Raises the <see cref="Control.Paint"/> event.
        /// </summary>
        /// <param name="pe">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param>
        protected override void OnPaint(PaintEventArgs pe)
        {
            string description;
            string methodCountMessage = null;

            if (DataProvider == null || DataProvider.InsightDataCount < 1)
            {
                description = "Unknown Method";
            }
            else
            {
                if (DataProvider.InsightDataCount > 1)
                {
                    methodCountMessage = TextEditorControl.GetRangeDescription(CurrentData + 1, DataProvider.InsightDataCount);
                }

                description = DataProvider.GetInsightData(CurrentData);
            }

            DrawingSize = TipPainterTools.GetDrawingSizeHelpTipFromCombinedDescription(this, pe.Graphics, Font, methodCountMessage, description);
            if (DrawingSize != Size)
            {
                SetLocation();
            }
            else
            {
                TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics, Font, methodCountMessage, description);
            }
        }